---
title: "Add an owned phone number to an approved A2P messaging service"
description: "Rechecks campaign approval before attachment. This does not assert carrier number registration or delivery readiness."
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Twilio

`POST /api/twilio/add-to-messaging-service`

Rechecks campaign approval before attachment. This does not assert carrier number registration or delivery readiness.

## Authentication

- `BearerAuth`, http, header `Authorization`, format `JWT`

## Header parameters

- `x-workspace-id` (`post/api/twilio/add-to-messaging-service.header.x-workspace-id`; string, required)

## Request body

_Required._

- `workspaceId` (`post/api/twilio/add-to-messaging-service.workspaceId`; string, required)
- `sid` (`post/api/twilio/add-to-messaging-service.sid`; string, optional) — Phone number SID; required for add and release
- `messagingServiceSid` (`post/api/twilio/add-to-messaging-service.messagingServiceSid`; string, optional) — Required for add

## Example request

```json
{
  "workspaceId": "string",
  "sid": "string",
  "messagingServiceSid": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/api/twilio/add-to-messaging-service \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-workspace-id: string' \
  --data '
{
  "workspaceId": "string",
  "sid": "string",
  "messagingServiceSid": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/twilio/add-to-messaging-service';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-workspace-id': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({workspaceId: 'string', sid: 'string', messagingServiceSid: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/twilio/add-to-messaging-service"

payload = {
    "workspaceId": "string",
    "sid": "string",
    "messagingServiceSid": "string"
}
headers = {
    "Content-Type": "application/json",
    "x-workspace-id": "string",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Action completed

### 400

Invalid input

### 401

Authentication required

### 403

Workspace mismatch

### 404

Configuration missing

### 409

Selected campaign is no longer approved; no attachment attempted

### 502

Provider action not confirmed

### 503

Campaign approval could not be checked before purchase


Source: https://developer.channelautomations.com/api/post-api-twilio-add-to-messaging-service/index.md
