# `Twilio.Messaging.V1.Service.Compliance.Usa2pService`
[🔗](https://github.com/jeffhuen/twilio_elixir/blob/main/lib/twilio/messaging/v1/service/compliance/usa2p_service.ex#L2)

A service for (fetch/create/delete) A2P Campaign for a Messaging Service

Operations: `list`, `create`, `fetch`, `update`, `delete`

# `create`

```elixir
@spec create(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Messaging.V1.Service.Compliance.Usa2p.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Operation: `CreateUsAppToPerson` | Tags: MessagingV1UsAppToPerson

## Required Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `BrandRegistrationSid` | string | A2P Brand Registration SID |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Description` | string | A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. |
| `HasEmbeddedLinks` | boolean | Indicates that this SMS campaign will send messages that contain links. |
| `HasEmbeddedPhone` | boolean | Indicates that this SMS campaign will send messages that contain phone numbers. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `MessageFlow` | string | Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `MessageSamples` | array | An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. |
| `UsAppToPersonUsecase` | string | A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..] |
## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `AgeGated` | boolean | A boolean that specifies whether campaign is age gated or not. |
| `DirectLending` | boolean | A boolean that specifies whether campaign allows direct lending or not. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `HelpKeywords` | array | End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `HelpMessage` | string | When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `OptInKeywords` | array | If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `OptInMessage` | string | If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `OptOutKeywords` | array | End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `OptOutMessage` | string | Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. |
| `SubscriberOptIn` | boolean | A boolean that specifies whether campaign has Subscriber Optin or not. |

# `delete`

```elixir
@spec delete(Twilio.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}
```

Operation: `DeleteUsAppToPerson` | Tags: MessagingV1UsAppToPerson

# `fetch`

```elixir
@spec fetch(Twilio.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, Twilio.Resources.Messaging.V1.Service.Compliance.Usa2p.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Operation: `FetchUsAppToPerson` | Tags: MessagingV1UsAppToPerson

# `list`

```elixir
@spec list(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Page.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Operation: `ListUsAppToPerson` | Tags: MessagingV1UsAppToPerson

# `stream`

```elixir
@spec stream(Twilio.Client.t(), String.t(), map(), keyword()) :: Enumerable.t()
```

Stream:  (lazy auto-pagination).

# `update`

```elixir
@spec update(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Messaging.V1.Service.Compliance.Usa2p.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Operation: `UpdateUsAppToPerson` | Tags: MessagingV1UsAppToPerson

## Required Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `AgeGated` | boolean | A boolean that specifies whether campaign requires age gate for federally legal content. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Description` | string | A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. |
| `DirectLending` | boolean | A boolean that specifies whether campaign allows direct lending or not. |
| `HasEmbeddedLinks` | boolean | Indicates that this SMS campaign will send messages that contain links. |
| `HasEmbeddedPhone` | boolean | Indicates that this SMS campaign will send messages that contain phone numbers. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `MessageFlow` | string | Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `MessageSamples` | array | An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. |

---

*Consult [api-reference.md](api-reference.md) for complete listing*
