sentdm

package module
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

README

Sent Go API Library

Go Reference

The Sent Go library provides convenient access to the Sent REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/sentdm/sent-dm-go" // imported as sentdm
)

Or to pin the version:

go get -u 'github.com/sentdm/sent-dm-go@v0.32.0'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/sentdm/sent-dm-go"
	"github.com/sentdm/sent-dm-go/option"
)

func main() {
	client := sentdm.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("SENT_DM_API_KEY")
	)
	response, err := client.Messages.Send(context.TODO(), sentdm.MessageSendParams{
		Channel: []string{"sms", "whatsapp"},
		Template: sentdm.MessageSendParamsTemplate{
			ID:   sentdm.String("7ba7b820-9dad-11d1-80b4-00c04fd430c8"),
			Name: sentdm.String("order_confirmation"),
			Parameters: map[string]string{
				"name":     "John Doe",
				"order_id": "12345",
			},
		},
		To: []string{"+14155551234", "+14155555678"},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response.Data)
}

Request fields

The sentdm library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `api:"required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, sentdm.String(string), sentdm.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := sentdm.ExampleParams{
	ID:   "id_xxx",             // required property
	Name: sentdm.String("..."), // optional property

	Point: sentdm.Point{
		X: 0,             // required field will serialize as 0
		Y: sentdm.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: sentdm.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[sentdm.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := sentdm.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Messages.Send(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *sentdm.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Messages.Send(context.TODO(), sentdm.MessageSendParams{
	Channel: []string{"sms"},
	Template: sentdm.MessageSendParamsTemplate{
		ID:   sentdm.String("7ba7b820-9dad-11d1-80b4-00c04fd430c8"),
		Name: sentdm.String("order_confirmation"),
		Parameters: map[string]string{
			"name":     "John Doe",
			"order_id": "12345",
		},
	},
	To: []string{"+14155551234"},
})
if err != nil {
	var apierr *sentdm.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/v3/messages": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Messages.Send(
	ctx,
	sentdm.MessageSendParams{
		Channel: []string{"sms"},
		Template: sentdm.MessageSendParamsTemplate{
			ID:   sentdm.String("7ba7b820-9dad-11d1-80b4-00c04fd430c8"),
			Name: sentdm.String("order_confirmation"),
			Parameters: map[string]string{
				"name":     "John Doe",
				"order_id": "12345",
			},
		},
		To: []string{"+14155551234"},
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper sentdm.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := sentdm.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Messages.Send(
	context.TODO(),
	sentdm.MessageSendParams{
		Channel: []string{"sms"},
		Template: sentdm.MessageSendParamsTemplate{
			ID:   sentdm.String("7ba7b820-9dad-11d1-80b4-00c04fd430c8"),
			Name: sentdm.String("order_confirmation"),
			Parameters: map[string]string{
				"name":     "John Doe",
				"order_id": "12345",
			},
		},
		To: []string{"+14155551234"},
	},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
response, err := client.Messages.Send(
	context.TODO(),
	sentdm.MessageSendParams{
		Channel: []string{"sms"},
		Template: sentdm.MessageSendParamsTemplate{
			ID:   sentdm.String("7ba7b820-9dad-11d1-80b4-00c04fd430c8"),
			Name: sentdm.String("order_confirmation"),
			Parameters: map[string]string{
				"name":     "John Doe",
				"order_id": "12345",
			},
		},
		To: []string{"+14155551234"},
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", response)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: sentdm.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := sentdm.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (SENT_DM_API_KEY, SENT_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type AuthenticationConfigParam added in v0.30.0

type AuthenticationConfigParam struct {
	// Code expiration time in minutes (1-90). If set, adds footer: "This code expires
	// in X minutes."
	CodeExpirationMinutes param.Opt[int64] `json:"codeExpirationMinutes,omitzero"`
	// Whether to add the security recommendation text: "For your security, do not
	// share this code."
	AddSecurityRecommendation param.Opt[bool] `json:"addSecurityRecommendation,omitzero"`
	// contains filtered or unexported fields
}

Configuration for AUTHENTICATION category templates

func (AuthenticationConfigParam) MarshalJSON added in v0.30.0

func (r AuthenticationConfigParam) MarshalJSON() (data []byte, err error)

func (*AuthenticationConfigParam) UnmarshalJSON added in v0.30.0

func (r *AuthenticationConfigParam) UnmarshalJSON(data []byte) error

type Client

type Client struct {
	Options []option.RequestOption
	// Delivery reports and inbound messages, pushed to you.
	//
	// Subscribe an endpoint to the event types you care about —
	// `GET /v3/webhooks/event-types` lists them — and we POST each one as it happens,
	// retrying on failure. Polling `GET /v3/messages/{id}` works and does not scale.
	//
	// **Verify the signature.** Every delivery is signed with your endpoint's secret;
	// an unverified endpoint is one anybody can post to. `rotate-secret` replaces it,
	// `test` sends a specimen event, and `GET /v3/webhooks/{id}/events` shows what we
	// tried to deliver and what your endpoint answered — which is the first place to
	// look when something appears to be missing.
	Webhooks WebhookService
	// The people who can sign in to your organization, and what each may do.
	//
	// Users are dashboard access and nothing else — they do not send, and removing one
	// does not affect traffic. An API key is not a user: it belongs to the
	// organization or to a sender profile, so revoking a person's access leaves your
	// integration running.
	Users UserService
	// Reusable message bodies with named variables.
	//
	// A template is substituted at send time from the values you pass, so the copy
	// lives here rather than in your application. WhatsApp templates additionally need
	// Meta's approval before they can be sent, and a template's channel status reports
	// where that stands — an approved SMS template and an unapproved WhatsApp one are
	// the same template in two states.
	Templates TemplateService
	// **Deprecated — use Sender Profiles.**
	//
	// The original profile resource, kept because it has live callers. It still works,
	// and its replacement is `/v3/sender-profiles`, which takes the identity and the
	// campaign in one call instead of across three.
	//
	// New integrations should not start here.
	Profiles ProfileService
	// What a phone number actually is, before you send to it.
	//
	// A lookup returns the number's country, line type and carrier, which is what
	// decides whether it is reachable on a channel and what it costs. Worth doing on
	// import rather than on send: a landline in a contact list is a message that can
	// never be delivered.
	Numbers NumberService
	// Send a message and follow what happened to it.
	//
	// One endpoint sends on any channel: pass `channel: "sent"` and we pick between
	// SMS, WhatsApp and RCS per recipient using your routing rules, or name a channel
	// to pin it. A send is accepted asynchronously — `POST /v3/messages` returns an
	// id, and delivery is reported through `GET /v3/messages/{id}`, its activities, or
	// a webhook.
	//
	// **A message needs a sender.** What you can send, where, and at what cost is
	// decided by the markets under **Channels** — so a recipient in a country you hold
	// no sender for is refused here rather than queued.
	Messages MessageService
	// The people you message, and their channel identities.
	//
	// A contact holds one identity per channel — a phone number, a WhatsApp number —
	// so routing can choose between them for the same person. Opt-out is recorded
	// against the contact and honoured on every send, whichever channel it came
	// through.
	//
	// `GET /v3/contacts/{id}/message-summary` is the per-contact view of what you have
	// sent and what happened to it.
	Contacts ContactService
	// Inbound and outbound messages, grouped by the person they are with.
	//
	// A conversation is the thread for one contact across every channel — a reply by
	// SMS and one by WhatsApp belong to the same conversation, because they are the
	// same person talking to you.
	//
	// Read-only. Sending is **Messages**; a reply arrives here and through your
	// webhooks.
	Conversations ConversationService
	// Who the current key is.
	//
	// `GET /v3/me` answers with the account the key authenticates as, which is the
	// quickest way to tell a live key from a test one, an organization key from a
	// sender profile's, and to confirm `x-profile-id` resolved to the profile you
	// meant.
	Me MeService
}

Client creates a struct with services and top level methods that help with interacting with the Sent API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (SENT_DM_API_KEY, SENT_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type ContactDeleteParams added in v0.7.0

type ContactDeleteParams struct {
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox    param.Opt[bool]   `json:"sandbox,omitzero"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ContactDeleteParams) MarshalJSON added in v0.7.0

func (r ContactDeleteParams) MarshalJSON() (data []byte, err error)

func (*ContactDeleteParams) UnmarshalJSON added in v0.7.0

func (r *ContactDeleteParams) UnmarshalJSON(data []byte) error

type ContactGetMessageSummaryParams added in v0.30.0

type ContactGetMessageSummaryParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type ContactGetMessageSummaryResponse added in v0.32.0

type ContactGetMessageSummaryResponse struct {
	// The response data (null if error)
	Data ContactGetMessageSummaryResponseData `json:"data" api:"nullable"`
	// Error information
	Error ContactGetMessageSummaryResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ContactGetMessageSummaryResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ContactGetMessageSummaryResponse) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ContactGetMessageSummaryResponse) UnmarshalJSON added in v0.32.0

func (r *ContactGetMessageSummaryResponse) UnmarshalJSON(data []byte) error

type ContactGetMessageSummaryResponseData added in v0.32.0

type ContactGetMessageSummaryResponseData struct {
	ChannelScores  []ContactGetMessageSummaryResponseDataChannelScore `json:"channel_scores"`
	ChannelsUsed   []string                                           `json:"channels_used"`
	ContactID      string                                             `json:"contact_id" format:"uuid"`
	FirstMessageAt time.Time                                          `json:"first_message_at" api:"nullable" format:"date-time"`
	LastMessageAt  time.Time                                          `json:"last_message_at" api:"nullable" format:"date-time"`
	MessageCount   int64                                              `json:"message_count"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChannelScores  respjson.Field
		ChannelsUsed   respjson.Field
		ContactID      respjson.Field
		FirstMessageAt respjson.Field
		LastMessageAt  respjson.Field
		MessageCount   respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The response data (null if error)

func (ContactGetMessageSummaryResponseData) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ContactGetMessageSummaryResponseData) UnmarshalJSON added in v0.32.0

func (r *ContactGetMessageSummaryResponseData) UnmarshalJSON(data []byte) error

type ContactGetMessageSummaryResponseDataChannelScore added in v0.32.0

type ContactGetMessageSummaryResponseDataChannelScore struct {
	Channel string `json:"channel"`
	// Percentage (0-100) of messages on this channel that ended in FAILED.
	FailScore int64 `json:"fail_score"`
	// Percentage (0-100) of messages on this channel that reached a successful
	// terminal state: SENT/DELIVERED/READ for outbound, RECEIVED for inbound.
	SuccessScore int64 `json:"success_score"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Channel      respjson.Field
		FailScore    respjson.Field
		SuccessScore respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ContactGetMessageSummaryResponseDataChannelScore) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ContactGetMessageSummaryResponseDataChannelScore) UnmarshalJSON added in v0.32.0

type ContactGetMessageSummaryResponseError added in v0.32.0

type ContactGetMessageSummaryResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ContactGetMessageSummaryResponseError) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ContactGetMessageSummaryResponseError) UnmarshalJSON added in v0.32.0

func (r *ContactGetMessageSummaryResponseError) UnmarshalJSON(data []byte) error

type ContactGetMessageSummaryResponseMeta added in v0.32.0

type ContactGetMessageSummaryResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ContactGetMessageSummaryResponseMeta) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ContactGetMessageSummaryResponseMeta) UnmarshalJSON added in v0.32.0

func (r *ContactGetMessageSummaryResponseMeta) UnmarshalJSON(data []byte) error

type ContactGetParams added in v0.8.0

type ContactGetParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type ContactGetResponse added in v0.23.0

type ContactGetResponse struct {
	// Contact response for v3 API Uses snake_case for JSON property names
	Data ContactGetResponseData `json:"data" api:"nullable"`
	// Error information
	Error ContactGetResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ContactGetResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ContactGetResponse) RawJSON added in v0.23.0

func (r ContactGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactGetResponse) UnmarshalJSON added in v0.23.0

func (r *ContactGetResponse) UnmarshalJSON(data []byte) error

type ContactGetResponseData added in v0.23.0

type ContactGetResponseData struct {
	// Unique identifier for the contact
	ID string `json:"id" format:"uuid"`
	// Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
	AvailableChannels string `json:"available_channels"`
	// Country calling code (e.g., 1 for US/Canada)
	CountryCode string `json:"country_code"`
	// When the contact was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" format:"uuid"`
	// Default messaging channel to use (e.g., "sms" or "whatsapp")
	DefaultChannel string `json:"default_channel"`
	// Phone number in E.164 format (e.g., +1234567890)
	FormatE164 string `json:"format_e164"`
	// Phone number in international format (e.g., +1 234-567-890)
	FormatInternational string `json:"format_international"`
	// Phone number in national format (e.g., (234) 567-890)
	FormatNational string `json:"format_national"`
	// Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
	FormatRfc string `json:"format_rfc"`
	// Always false. Contacts are no longer shared or inherited between sender profiles
	// — a profile sees only the contacts it owns. Retained so existing v3 clients
	// reading is_inherited keep deserializing; it carries no information.
	//
	// Deprecated: deprecated
	IsInherited bool `json:"is_inherited"`
	// Whether the contact has opted out of messaging. Single source of truth — opt-out
	// is per-contact, not per-channel.
	OptOut bool `json:"opt_out"`
	// Phone number in original format
	PhoneNumber string `json:"phone_number"`
	// ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
	RegionCode string `json:"region_code"`
	// When the contact was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		AvailableChannels   respjson.Field
		CountryCode         respjson.Field
		CreatedAt           respjson.Field
		CustomerID          respjson.Field
		DefaultChannel      respjson.Field
		FormatE164          respjson.Field
		FormatInternational respjson.Field
		FormatNational      respjson.Field
		FormatRfc           respjson.Field
		IsInherited         respjson.Field
		OptOut              respjson.Field
		PhoneNumber         respjson.Field
		RegionCode          respjson.Field
		UpdatedAt           respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Contact response for v3 API Uses snake_case for JSON property names

func (ContactGetResponseData) RawJSON added in v0.23.0

func (r ContactGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactGetResponseData) UnmarshalJSON added in v0.23.0

func (r *ContactGetResponseData) UnmarshalJSON(data []byte) error

type ContactGetResponseError added in v0.23.0

type ContactGetResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ContactGetResponseError) RawJSON added in v0.23.0

func (r ContactGetResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactGetResponseError) UnmarshalJSON added in v0.23.0

func (r *ContactGetResponseError) UnmarshalJSON(data []byte) error

type ContactGetResponseMeta added in v0.23.0

type ContactGetResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ContactGetResponseMeta) RawJSON added in v0.23.0

func (r ContactGetResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactGetResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ContactGetResponseMeta) UnmarshalJSON(data []byte) error

type ContactListParams

type ContactListParams struct {
	// Page number (1-indexed)
	Page int64 `query:"page" api:"required" json:"-"`
	// Number of items per page
	PageSize int64 `query:"page_size" api:"required" json:"-"`
	// Optional channel filter (sms, whatsapp)
	Channel param.Opt[string] `query:"channel,omitzero" json:"-"`
	// Optional phone number filter (alternative to list view)
	Phone param.Opt[string] `query:"phone,omitzero" json:"-"`
	// Optional search term for filtering contacts
	Search     param.Opt[string] `query:"search,omitzero" json:"-"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ContactListParams) URLQuery

func (r ContactListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ContactListParams's query parameters as `url.Values`.

type ContactListResponse

type ContactListResponse struct {
	// A paginated list of contacts.
	Data ContactListResponseData `json:"data" api:"nullable"`
	// Error information
	Error ContactListResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ContactListResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ContactListResponse) RawJSON

func (r ContactListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactListResponse) UnmarshalJSON

func (r *ContactListResponse) UnmarshalJSON(data []byte) error

type ContactListResponseData added in v0.7.0

type ContactListResponseData struct {
	// The contacts on this page.
	Contacts []ContactListResponseDataContact `json:"contacts"`
	// Pagination metadata for list responses
	Pagination ContactListResponseDataPagination `json:"pagination"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Contacts    respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A paginated list of contacts.

func (ContactListResponseData) RawJSON added in v0.7.0

func (r ContactListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactListResponseData) UnmarshalJSON added in v0.7.0

func (r *ContactListResponseData) UnmarshalJSON(data []byte) error

type ContactListResponseDataContact added in v0.23.0

type ContactListResponseDataContact struct {
	// Unique identifier for the contact
	ID string `json:"id" format:"uuid"`
	// Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
	AvailableChannels string `json:"available_channels"`
	// Country calling code (e.g., 1 for US/Canada)
	CountryCode string `json:"country_code"`
	// When the contact was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" format:"uuid"`
	// Default messaging channel to use (e.g., "sms" or "whatsapp")
	DefaultChannel string `json:"default_channel"`
	// Phone number in E.164 format (e.g., +1234567890)
	FormatE164 string `json:"format_e164"`
	// Phone number in international format (e.g., +1 234-567-890)
	FormatInternational string `json:"format_international"`
	// Phone number in national format (e.g., (234) 567-890)
	FormatNational string `json:"format_national"`
	// Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
	FormatRfc string `json:"format_rfc"`
	// Always false. Contacts are no longer shared or inherited between sender profiles
	// — a profile sees only the contacts it owns. Retained so existing v3 clients
	// reading is_inherited keep deserializing; it carries no information.
	//
	// Deprecated: deprecated
	IsInherited bool `json:"is_inherited"`
	// Whether the contact has opted out of messaging. Single source of truth — opt-out
	// is per-contact, not per-channel.
	OptOut bool `json:"opt_out"`
	// Phone number in original format
	PhoneNumber string `json:"phone_number"`
	// ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
	RegionCode string `json:"region_code"`
	// When the contact was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		AvailableChannels   respjson.Field
		CountryCode         respjson.Field
		CreatedAt           respjson.Field
		CustomerID          respjson.Field
		DefaultChannel      respjson.Field
		FormatE164          respjson.Field
		FormatInternational respjson.Field
		FormatNational      respjson.Field
		FormatRfc           respjson.Field
		IsInherited         respjson.Field
		OptOut              respjson.Field
		PhoneNumber         respjson.Field
		RegionCode          respjson.Field
		UpdatedAt           respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Contact response for v3 API Uses snake_case for JSON property names

func (ContactListResponseDataContact) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ContactListResponseDataContact) UnmarshalJSON added in v0.23.0

func (r *ContactListResponseDataContact) UnmarshalJSON(data []byte) error

type ContactListResponseDataPagination added in v0.23.0

type ContactListResponseDataPagination struct {
	// Cursor-based pagination. Never populated — see Cursors.
	//
	// Deprecated: deprecated
	Cursors ContactListResponseDataPaginationCursors `json:"cursors" api:"nullable"`
	// Whether there are more pages after this one
	HasMore bool `json:"has_more"`
	// Current page number (1-indexed)
	Page int64 `json:"page"`
	// Number of items per page
	PageSize int64 `json:"page_size"`
	// Total number of items across all pages
	TotalCount int64 `json:"total_count"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cursors     respjson.Field
		HasMore     respjson.Field
		Page        respjson.Field
		PageSize    respjson.Field
		TotalCount  respjson.Field
		TotalPages  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata for list responses

func (ContactListResponseDataPagination) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ContactListResponseDataPagination) UnmarshalJSON added in v0.23.0

func (r *ContactListResponseDataPagination) UnmarshalJSON(data []byte) error

type ContactListResponseDataPaginationCursors deprecated added in v0.23.0

type ContactListResponseDataPaginationCursors struct {
	// Cursor to fetch the next page.
	After string `json:"after" api:"nullable"`
	// Cursor to fetch the previous page.
	Before string `json:"before" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cursor-based pagination. Never populated — see Cursors.

Deprecated: deprecated

func (ContactListResponseDataPaginationCursors) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ContactListResponseDataPaginationCursors) UnmarshalJSON added in v0.23.0

func (r *ContactListResponseDataPaginationCursors) UnmarshalJSON(data []byte) error

type ContactListResponseError added in v0.23.0

type ContactListResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ContactListResponseError) RawJSON added in v0.23.0

func (r ContactListResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactListResponseError) UnmarshalJSON added in v0.23.0

func (r *ContactListResponseError) UnmarshalJSON(data []byte) error

type ContactListResponseMeta added in v0.23.0

type ContactListResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ContactListResponseMeta) RawJSON added in v0.23.0

func (r ContactListResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactListResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ContactListResponseMeta) UnmarshalJSON(data []byte) error

type ContactNewParams added in v0.7.0

type ContactNewParams struct {
	// Phone number of the contact to create
	PhoneNumber string `json:"phone_number" api:"required"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ContactNewParams) MarshalJSON added in v0.7.0

func (r ContactNewParams) MarshalJSON() (data []byte, err error)

func (*ContactNewParams) UnmarshalJSON added in v0.7.0

func (r *ContactNewParams) UnmarshalJSON(data []byte) error

type ContactNewResponse added in v0.23.0

type ContactNewResponse struct {
	// Contact response for v3 API Uses snake_case for JSON property names
	Data ContactNewResponseData `json:"data" api:"nullable"`
	// Error information
	Error ContactNewResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ContactNewResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ContactNewResponse) RawJSON added in v0.23.0

func (r ContactNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactNewResponse) UnmarshalJSON added in v0.23.0

func (r *ContactNewResponse) UnmarshalJSON(data []byte) error

type ContactNewResponseData added in v0.23.0

type ContactNewResponseData struct {
	// Unique identifier for the contact
	ID string `json:"id" format:"uuid"`
	// Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
	AvailableChannels string `json:"available_channels"`
	// Country calling code (e.g., 1 for US/Canada)
	CountryCode string `json:"country_code"`
	// When the contact was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" format:"uuid"`
	// Default messaging channel to use (e.g., "sms" or "whatsapp")
	DefaultChannel string `json:"default_channel"`
	// Phone number in E.164 format (e.g., +1234567890)
	FormatE164 string `json:"format_e164"`
	// Phone number in international format (e.g., +1 234-567-890)
	FormatInternational string `json:"format_international"`
	// Phone number in national format (e.g., (234) 567-890)
	FormatNational string `json:"format_national"`
	// Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
	FormatRfc string `json:"format_rfc"`
	// Always false. Contacts are no longer shared or inherited between sender profiles
	// — a profile sees only the contacts it owns. Retained so existing v3 clients
	// reading is_inherited keep deserializing; it carries no information.
	//
	// Deprecated: deprecated
	IsInherited bool `json:"is_inherited"`
	// Whether the contact has opted out of messaging. Single source of truth — opt-out
	// is per-contact, not per-channel.
	OptOut bool `json:"opt_out"`
	// Phone number in original format
	PhoneNumber string `json:"phone_number"`
	// ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
	RegionCode string `json:"region_code"`
	// When the contact was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		AvailableChannels   respjson.Field
		CountryCode         respjson.Field
		CreatedAt           respjson.Field
		CustomerID          respjson.Field
		DefaultChannel      respjson.Field
		FormatE164          respjson.Field
		FormatInternational respjson.Field
		FormatNational      respjson.Field
		FormatRfc           respjson.Field
		IsInherited         respjson.Field
		OptOut              respjson.Field
		PhoneNumber         respjson.Field
		RegionCode          respjson.Field
		UpdatedAt           respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Contact response for v3 API Uses snake_case for JSON property names

func (ContactNewResponseData) RawJSON added in v0.23.0

func (r ContactNewResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactNewResponseData) UnmarshalJSON added in v0.23.0

func (r *ContactNewResponseData) UnmarshalJSON(data []byte) error

type ContactNewResponseError added in v0.23.0

type ContactNewResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ContactNewResponseError) RawJSON added in v0.23.0

func (r ContactNewResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactNewResponseError) UnmarshalJSON added in v0.23.0

func (r *ContactNewResponseError) UnmarshalJSON(data []byte) error

type ContactNewResponseMeta added in v0.23.0

type ContactNewResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ContactNewResponseMeta) RawJSON added in v0.23.0

func (r ContactNewResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactNewResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ContactNewResponseMeta) UnmarshalJSON(data []byte) error

type ContactService

type ContactService struct {
	Options []option.RequestOption
}

The people you message, and their channel identities.

A contact holds one identity per channel — a phone number, a WhatsApp number — so routing can choose between them for the same person. Opt-out is recorded against the contact and honoured on every send, whichever channel it came through.

`GET /v3/contacts/{id}/message-summary` is the per-contact view of what you have sent and what happened to it.

ContactService contains methods and other services that help with interacting with the Sent API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewContactService method instead.

func NewContactService

func NewContactService(opts ...option.RequestOption) (r ContactService)

NewContactService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ContactService) Delete deprecated added in v0.7.0

func (r *ContactService) Delete(ctx context.Context, id string, params ContactDeleteParams, opts ...option.RequestOption) (err error)

**Deprecated.** Use `PATCH /v3/contacts/{id}` with `{"opt_out": true}` instead, and expect this to be removed in a future release. It still behaves exactly as before, so nothing needs to change today.

Opting a contact out stops every send to them, which is what deleting one was mostly used for — and it keeps the record of who they were and that they asked. A delete discards the consent history along with the contact, which is the part you need if anyone ever asks why you stopped, or why you started again.

Dissociates a contact from the authenticated customer.

Deprecated: deprecated

func (*ContactService) Get added in v0.7.0

Retrieves a specific contact by their unique identifier. Returns detailed contact information including phone formats, available channels, and opt-out status.

func (*ContactService) GetMessageSummary added in v0.30.0

func (r *ContactService) GetMessageSummary(ctx context.Context, contactID string, query ContactGetMessageSummaryParams, opts ...option.RequestOption) (res *ContactGetMessageSummaryResponse, err error)

Returns aggregate message counts, time bounds, channels used, and per-channel success/fail scores (each as a percentage 0-100 of messages on that channel) for one of your contacts. Successful terminal states: SENT/DELIVERED/READ for outbound, RECEIVED for inbound. Fail: FAILED.

func (*ContactService) List

Retrieves a paginated list of contacts for the authenticated customer. Supports filtering by search term, channel, or phone number.

func (*ContactService) New added in v0.7.0

Creates a new contact by phone number and associates it with the authenticated customer.

func (*ContactService) Update added in v0.7.0

Updates a contact's default channel and/or opt-out status.

type ContactUpdateParams added in v0.7.0

type ContactUpdateParams struct {
	// Default messaging channel: "sms" or "whatsapp"
	DefaultChannel param.Opt[string] `json:"default_channel,omitzero"`
	// Whether the contact has opted out of messaging. Single source of truth — opt-out
	// is per-contact, not per-channel.
	OptOut param.Opt[bool] `json:"opt_out,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ContactUpdateParams) MarshalJSON added in v0.7.0

func (r ContactUpdateParams) MarshalJSON() (data []byte, err error)

func (*ContactUpdateParams) UnmarshalJSON added in v0.7.0

func (r *ContactUpdateParams) UnmarshalJSON(data []byte) error

type ContactUpdateResponse added in v0.23.0

type ContactUpdateResponse struct {
	// Contact response for v3 API Uses snake_case for JSON property names
	Data ContactUpdateResponseData `json:"data" api:"nullable"`
	// Error information
	Error ContactUpdateResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ContactUpdateResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ContactUpdateResponse) RawJSON added in v0.23.0

func (r ContactUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactUpdateResponse) UnmarshalJSON added in v0.23.0

func (r *ContactUpdateResponse) UnmarshalJSON(data []byte) error

type ContactUpdateResponseData added in v0.23.0

type ContactUpdateResponseData struct {
	// Unique identifier for the contact
	ID string `json:"id" format:"uuid"`
	// Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
	AvailableChannels string `json:"available_channels"`
	// Country calling code (e.g., 1 for US/Canada)
	CountryCode string `json:"country_code"`
	// When the contact was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" format:"uuid"`
	// Default messaging channel to use (e.g., "sms" or "whatsapp")
	DefaultChannel string `json:"default_channel"`
	// Phone number in E.164 format (e.g., +1234567890)
	FormatE164 string `json:"format_e164"`
	// Phone number in international format (e.g., +1 234-567-890)
	FormatInternational string `json:"format_international"`
	// Phone number in national format (e.g., (234) 567-890)
	FormatNational string `json:"format_national"`
	// Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
	FormatRfc string `json:"format_rfc"`
	// Always false. Contacts are no longer shared or inherited between sender profiles
	// — a profile sees only the contacts it owns. Retained so existing v3 clients
	// reading is_inherited keep deserializing; it carries no information.
	//
	// Deprecated: deprecated
	IsInherited bool `json:"is_inherited"`
	// Whether the contact has opted out of messaging. Single source of truth — opt-out
	// is per-contact, not per-channel.
	OptOut bool `json:"opt_out"`
	// Phone number in original format
	PhoneNumber string `json:"phone_number"`
	// ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
	RegionCode string `json:"region_code"`
	// When the contact was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		AvailableChannels   respjson.Field
		CountryCode         respjson.Field
		CreatedAt           respjson.Field
		CustomerID          respjson.Field
		DefaultChannel      respjson.Field
		FormatE164          respjson.Field
		FormatInternational respjson.Field
		FormatNational      respjson.Field
		FormatRfc           respjson.Field
		IsInherited         respjson.Field
		OptOut              respjson.Field
		PhoneNumber         respjson.Field
		RegionCode          respjson.Field
		UpdatedAt           respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Contact response for v3 API Uses snake_case for JSON property names

func (ContactUpdateResponseData) RawJSON added in v0.23.0

func (r ContactUpdateResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactUpdateResponseData) UnmarshalJSON added in v0.23.0

func (r *ContactUpdateResponseData) UnmarshalJSON(data []byte) error

type ContactUpdateResponseError added in v0.23.0

type ContactUpdateResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ContactUpdateResponseError) RawJSON added in v0.23.0

func (r ContactUpdateResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactUpdateResponseError) UnmarshalJSON added in v0.23.0

func (r *ContactUpdateResponseError) UnmarshalJSON(data []byte) error

type ContactUpdateResponseMeta added in v0.23.0

type ContactUpdateResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ContactUpdateResponseMeta) RawJSON added in v0.23.0

func (r ContactUpdateResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContactUpdateResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ContactUpdateResponseMeta) UnmarshalJSON(data []byte) error

type ConversationListMessagesParams added in v0.30.0

type ConversationListMessagesParams struct {
	Page       int64             `query:"page" api:"required" json:"-"`
	PageSize   int64             `query:"page_size" api:"required" json:"-"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ConversationListMessagesParams) URLQuery added in v0.30.0

func (r ConversationListMessagesParams) URLQuery() (v url.Values, err error)

URLQuery serializes ConversationListMessagesParams's query parameters as `url.Values`.

type ConversationListMessagesResponse added in v0.32.0

type ConversationListMessagesResponse struct {
	// A paginated list of messages — used by both conversation read endpoints.
	Data ConversationListMessagesResponseData `json:"data" api:"nullable"`
	// Error information
	Error ConversationListMessagesResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ConversationListMessagesResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ConversationListMessagesResponse) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListMessagesResponse) UnmarshalJSON added in v0.32.0

func (r *ConversationListMessagesResponse) UnmarshalJSON(data []byte) error

type ConversationListMessagesResponseData added in v0.32.0

type ConversationListMessagesResponseData struct {
	// The messages on this page.
	Messages []ConversationListMessagesResponseDataMessage `json:"messages"`
	// Pagination metadata for list responses
	Pagination ConversationListMessagesResponseDataPagination `json:"pagination"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Messages    respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A paginated list of messages — used by both conversation read endpoints.

func (ConversationListMessagesResponseData) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListMessagesResponseData) UnmarshalJSON added in v0.32.0

func (r *ConversationListMessagesResponseData) UnmarshalJSON(data []byte) error

type ConversationListMessagesResponseDataMessage added in v0.32.0

type ConversationListMessagesResponseDataMessage struct {
	ID                 string                                             `json:"id" format:"uuid"`
	ActiveContactPrice float64                                            `json:"active_contact_price" api:"nullable" format:"decimal"`
	Channel            string                                             `json:"channel"`
	ContactID          string                                             `json:"contact_id" format:"uuid"`
	CreatedAt          time.Time                                          `json:"created_at" format:"date-time"`
	CustomerID         string                                             `json:"customer_id" format:"uuid"`
	Direction          string                                             `json:"direction"`
	Events             []ConversationListMessagesResponseDataMessageEvent `json:"events" api:"nullable"`
	// Structured message body format for database storage. Preserves channel-specific
	// components (header, body, footer, buttons).
	MessageBody        ConversationListMessagesResponseDataMessageMessageBody `json:"message_body" api:"nullable"`
	Phone              string                                                 `json:"phone"`
	PhoneInternational string                                                 `json:"phone_international"`
	Price              float64                                                `json:"price" api:"nullable" format:"decimal"`
	RegionCode         string                                                 `json:"region_code"`
	Status             string                                                 `json:"status"`
	TemplateCategory   string                                                 `json:"template_category" api:"nullable"`
	TemplateID         string                                                 `json:"template_id" api:"nullable" format:"uuid"`
	TemplateName       string                                                 `json:"template_name" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		ActiveContactPrice respjson.Field
		Channel            respjson.Field
		ContactID          respjson.Field
		CreatedAt          respjson.Field
		CustomerID         respjson.Field
		Direction          respjson.Field
		Events             respjson.Field
		MessageBody        respjson.Field
		Phone              respjson.Field
		PhoneInternational respjson.Field
		Price              respjson.Field
		RegionCode         respjson.Field
		Status             respjson.Field
		TemplateCategory   respjson.Field
		TemplateID         respjson.Field
		TemplateName       respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Message response for v3 API — same shape as v2 with snake_case JSON conventions

func (ConversationListMessagesResponseDataMessage) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListMessagesResponseDataMessage) UnmarshalJSON added in v0.32.0

func (r *ConversationListMessagesResponseDataMessage) UnmarshalJSON(data []byte) error

type ConversationListMessagesResponseDataMessageEvent added in v0.32.0

type ConversationListMessagesResponseDataMessageEvent struct {
	Status      string    `json:"status" api:"required"`
	Timestamp   time.Time `json:"timestamp" api:"required" format:"date-time"`
	Description string    `json:"description" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		Timestamp   respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a status change event in a message's lifecycle (v3)

func (ConversationListMessagesResponseDataMessageEvent) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListMessagesResponseDataMessageEvent) UnmarshalJSON added in v0.32.0

type ConversationListMessagesResponseDataMessageMessageBody added in v0.32.0

type ConversationListMessagesResponseDataMessageMessageBody struct {
	Buttons []ConversationListMessagesResponseDataMessageMessageBodyButton `json:"buttons" api:"nullable"`
	Content string                                                         `json:"content"`
	Footer  string                                                         `json:"footer" api:"nullable"`
	Header  string                                                         `json:"header" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Buttons     respjson.Field
		Content     respjson.Field
		Footer      respjson.Field
		Header      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured message body format for database storage. Preserves channel-specific components (header, body, footer, buttons).

func (ConversationListMessagesResponseDataMessageMessageBody) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListMessagesResponseDataMessageMessageBody) UnmarshalJSON added in v0.32.0

type ConversationListMessagesResponseDataMessageMessageBodyButton added in v0.32.0

type ConversationListMessagesResponseDataMessageMessageBodyButton struct {
	PostbackData string `json:"postbackData" api:"nullable"`
	Text         string `json:"text" api:"nullable"`
	Type         string `json:"type"`
	Value        string `json:"value"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PostbackData respjson.Field
		Text         respjson.Field
		Type         respjson.Field
		Value        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ConversationListMessagesResponseDataMessageMessageBodyButton) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListMessagesResponseDataMessageMessageBodyButton) UnmarshalJSON added in v0.32.0

type ConversationListMessagesResponseDataPagination added in v0.32.0

type ConversationListMessagesResponseDataPagination struct {
	// Cursor-based pagination. Never populated — see Cursors.
	//
	// Deprecated: deprecated
	Cursors ConversationListMessagesResponseDataPaginationCursors `json:"cursors" api:"nullable"`
	// Whether there are more pages after this one
	HasMore bool `json:"has_more"`
	// Current page number (1-indexed)
	Page int64 `json:"page"`
	// Number of items per page
	PageSize int64 `json:"page_size"`
	// Total number of items across all pages
	TotalCount int64 `json:"total_count"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cursors     respjson.Field
		HasMore     respjson.Field
		Page        respjson.Field
		PageSize    respjson.Field
		TotalCount  respjson.Field
		TotalPages  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata for list responses

func (ConversationListMessagesResponseDataPagination) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListMessagesResponseDataPagination) UnmarshalJSON added in v0.32.0

type ConversationListMessagesResponseDataPaginationCursors deprecated added in v0.32.0

type ConversationListMessagesResponseDataPaginationCursors struct {
	// Cursor to fetch the next page.
	After string `json:"after" api:"nullable"`
	// Cursor to fetch the previous page.
	Before string `json:"before" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cursor-based pagination. Never populated — see Cursors.

Deprecated: deprecated

func (ConversationListMessagesResponseDataPaginationCursors) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListMessagesResponseDataPaginationCursors) UnmarshalJSON added in v0.32.0

type ConversationListMessagesResponseError added in v0.32.0

type ConversationListMessagesResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ConversationListMessagesResponseError) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListMessagesResponseError) UnmarshalJSON added in v0.32.0

func (r *ConversationListMessagesResponseError) UnmarshalJSON(data []byte) error

type ConversationListMessagesResponseMeta added in v0.32.0

type ConversationListMessagesResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ConversationListMessagesResponseMeta) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListMessagesResponseMeta) UnmarshalJSON added in v0.32.0

func (r *ConversationListMessagesResponseMeta) UnmarshalJSON(data []byte) error

type ConversationListParams added in v0.30.0

type ConversationListParams struct {
	Page       int64             `query:"page" api:"required" json:"-"`
	PageSize   int64             `query:"page_size" api:"required" json:"-"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ConversationListParams) URLQuery added in v0.30.0

func (r ConversationListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ConversationListParams's query parameters as `url.Values`.

type ConversationListResponse added in v0.32.0

type ConversationListResponse struct {
	// A paginated list of messages — used by both conversation read endpoints.
	Data ConversationListResponseData `json:"data" api:"nullable"`
	// Error information
	Error ConversationListResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ConversationListResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ConversationListResponse) RawJSON added in v0.32.0

func (r ConversationListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ConversationListResponse) UnmarshalJSON added in v0.32.0

func (r *ConversationListResponse) UnmarshalJSON(data []byte) error

type ConversationListResponseData added in v0.32.0

type ConversationListResponseData struct {
	// The messages on this page.
	Messages []ConversationListResponseDataMessage `json:"messages"`
	// Pagination metadata for list responses
	Pagination ConversationListResponseDataPagination `json:"pagination"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Messages    respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A paginated list of messages — used by both conversation read endpoints.

func (ConversationListResponseData) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListResponseData) UnmarshalJSON added in v0.32.0

func (r *ConversationListResponseData) UnmarshalJSON(data []byte) error

type ConversationListResponseDataMessage added in v0.32.0

type ConversationListResponseDataMessage struct {
	ID                 string                                     `json:"id" format:"uuid"`
	ActiveContactPrice float64                                    `json:"active_contact_price" api:"nullable" format:"decimal"`
	Channel            string                                     `json:"channel"`
	ContactID          string                                     `json:"contact_id" format:"uuid"`
	CreatedAt          time.Time                                  `json:"created_at" format:"date-time"`
	CustomerID         string                                     `json:"customer_id" format:"uuid"`
	Direction          string                                     `json:"direction"`
	Events             []ConversationListResponseDataMessageEvent `json:"events" api:"nullable"`
	// Structured message body format for database storage. Preserves channel-specific
	// components (header, body, footer, buttons).
	MessageBody        ConversationListResponseDataMessageMessageBody `json:"message_body" api:"nullable"`
	Phone              string                                         `json:"phone"`
	PhoneInternational string                                         `json:"phone_international"`
	Price              float64                                        `json:"price" api:"nullable" format:"decimal"`
	RegionCode         string                                         `json:"region_code"`
	Status             string                                         `json:"status"`
	TemplateCategory   string                                         `json:"template_category" api:"nullable"`
	TemplateID         string                                         `json:"template_id" api:"nullable" format:"uuid"`
	TemplateName       string                                         `json:"template_name" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		ActiveContactPrice respjson.Field
		Channel            respjson.Field
		ContactID          respjson.Field
		CreatedAt          respjson.Field
		CustomerID         respjson.Field
		Direction          respjson.Field
		Events             respjson.Field
		MessageBody        respjson.Field
		Phone              respjson.Field
		PhoneInternational respjson.Field
		Price              respjson.Field
		RegionCode         respjson.Field
		Status             respjson.Field
		TemplateCategory   respjson.Field
		TemplateID         respjson.Field
		TemplateName       respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Message response for v3 API — same shape as v2 with snake_case JSON conventions

func (ConversationListResponseDataMessage) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListResponseDataMessage) UnmarshalJSON added in v0.32.0

func (r *ConversationListResponseDataMessage) UnmarshalJSON(data []byte) error

type ConversationListResponseDataMessageEvent added in v0.32.0

type ConversationListResponseDataMessageEvent struct {
	Status      string    `json:"status" api:"required"`
	Timestamp   time.Time `json:"timestamp" api:"required" format:"date-time"`
	Description string    `json:"description" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		Timestamp   respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a status change event in a message's lifecycle (v3)

func (ConversationListResponseDataMessageEvent) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListResponseDataMessageEvent) UnmarshalJSON added in v0.32.0

func (r *ConversationListResponseDataMessageEvent) UnmarshalJSON(data []byte) error

type ConversationListResponseDataMessageMessageBody added in v0.32.0

type ConversationListResponseDataMessageMessageBody struct {
	Buttons []ConversationListResponseDataMessageMessageBodyButton `json:"buttons" api:"nullable"`
	Content string                                                 `json:"content"`
	Footer  string                                                 `json:"footer" api:"nullable"`
	Header  string                                                 `json:"header" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Buttons     respjson.Field
		Content     respjson.Field
		Footer      respjson.Field
		Header      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured message body format for database storage. Preserves channel-specific components (header, body, footer, buttons).

func (ConversationListResponseDataMessageMessageBody) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListResponseDataMessageMessageBody) UnmarshalJSON added in v0.32.0

type ConversationListResponseDataMessageMessageBodyButton added in v0.32.0

type ConversationListResponseDataMessageMessageBodyButton struct {
	PostbackData string `json:"postbackData" api:"nullable"`
	Text         string `json:"text" api:"nullable"`
	Type         string `json:"type"`
	Value        string `json:"value"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PostbackData respjson.Field
		Text         respjson.Field
		Type         respjson.Field
		Value        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ConversationListResponseDataMessageMessageBodyButton) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListResponseDataMessageMessageBodyButton) UnmarshalJSON added in v0.32.0

type ConversationListResponseDataPagination added in v0.32.0

type ConversationListResponseDataPagination struct {
	// Cursor-based pagination. Never populated — see Cursors.
	//
	// Deprecated: deprecated
	Cursors ConversationListResponseDataPaginationCursors `json:"cursors" api:"nullable"`
	// Whether there are more pages after this one
	HasMore bool `json:"has_more"`
	// Current page number (1-indexed)
	Page int64 `json:"page"`
	// Number of items per page
	PageSize int64 `json:"page_size"`
	// Total number of items across all pages
	TotalCount int64 `json:"total_count"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cursors     respjson.Field
		HasMore     respjson.Field
		Page        respjson.Field
		PageSize    respjson.Field
		TotalCount  respjson.Field
		TotalPages  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata for list responses

func (ConversationListResponseDataPagination) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListResponseDataPagination) UnmarshalJSON added in v0.32.0

func (r *ConversationListResponseDataPagination) UnmarshalJSON(data []byte) error

type ConversationListResponseDataPaginationCursors deprecated added in v0.32.0

type ConversationListResponseDataPaginationCursors struct {
	// Cursor to fetch the next page.
	After string `json:"after" api:"nullable"`
	// Cursor to fetch the previous page.
	Before string `json:"before" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cursor-based pagination. Never populated — see Cursors.

Deprecated: deprecated

func (ConversationListResponseDataPaginationCursors) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListResponseDataPaginationCursors) UnmarshalJSON added in v0.32.0

func (r *ConversationListResponseDataPaginationCursors) UnmarshalJSON(data []byte) error

type ConversationListResponseError added in v0.32.0

type ConversationListResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ConversationListResponseError) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListResponseError) UnmarshalJSON added in v0.32.0

func (r *ConversationListResponseError) UnmarshalJSON(data []byte) error

type ConversationListResponseMeta added in v0.32.0

type ConversationListResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ConversationListResponseMeta) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ConversationListResponseMeta) UnmarshalJSON added in v0.32.0

func (r *ConversationListResponseMeta) UnmarshalJSON(data []byte) error

type ConversationService added in v0.30.0

type ConversationService struct {
	Options []option.RequestOption
}

Inbound and outbound messages, grouped by the person they are with.

A conversation is the thread for one contact across every channel — a reply by SMS and one by WhatsApp belong to the same conversation, because they are the same person talking to you.

Read-only. Sending is **Messages**; a reply arrives here and through your webhooks.

ConversationService contains methods and other services that help with interacting with the Sent API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConversationService method instead.

func NewConversationService added in v0.30.0

func NewConversationService(opts ...option.RequestOption) (r ConversationService)

NewConversationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ConversationService) List added in v0.30.0

Retrieves a paginated list of the authenticated customer's messages across all conversations, ordered by created date (most recent first).

func (*ConversationService) ListMessages added in v0.30.0

Retrieves a paginated list of the messages in a single conversation (scoped to the authenticated customer), ordered by created date (most recent first).

type DestinationCountry added in v0.7.0

type DestinationCountry struct {
	ID     string `json:"id"`
	IsMain bool   `json:"isMain"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		IsMain      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DestinationCountry) RawJSON added in v0.7.0

func (r DestinationCountry) RawJSON() string

Returns the unmodified JSON received from the API

func (DestinationCountry) ToParam added in v0.7.0

ToParam converts this DestinationCountry to a DestinationCountryParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with DestinationCountryParam.Overrides()

func (*DestinationCountry) UnmarshalJSON added in v0.7.0

func (r *DestinationCountry) UnmarshalJSON(data []byte) error

type DestinationCountryParam added in v0.7.0

type DestinationCountryParam struct {
	ID     param.Opt[string] `json:"id,omitzero"`
	IsMain param.Opt[bool]   `json:"isMain,omitzero"`
	// contains filtered or unexported fields
}

func (DestinationCountryParam) MarshalJSON added in v0.7.0

func (r DestinationCountryParam) MarshalJSON() (data []byte, err error)

func (*DestinationCountryParam) UnmarshalJSON added in v0.7.0

func (r *DestinationCountryParam) UnmarshalJSON(data []byte) error

type Error

type Error = apierror.Error

type InboundMessageEvent added in v0.31.0

type InboundMessageEvent struct {
	// The specific event within the family, for example message.delivered or
	// message.received. Absent on events that have no subtype, so treat it as
	// optional.
	Event string `json:"event" api:"nullable"`
	// The event family, for example message or templates. Route on this first, then on
	// event for the specific change.
	Field string `json:"field"`
	// Body of a message.received event. Delivered when a contact messages one of your
	// numbers.
	Payload InboundMessageEventPayload `json:"payload" api:"nullable"`
	// When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
	// time, not the time the underlying change happened. Use the timestamp inside the
	// payload for the latter.
	Timestamp string `json:"timestamp"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Event       respjson.Field
		Field       respjson.Field
		Payload     respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and varies only in Payload.

func (InboundMessageEvent) RawJSON added in v0.31.0

func (r InboundMessageEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*InboundMessageEvent) UnmarshalJSON added in v0.31.0

func (r *InboundMessageEvent) UnmarshalJSON(data []byte) error

type InboundMessageEventPayload added in v0.31.0

type InboundMessageEventPayload struct {
	// The account the message belongs to.
	AccountID string `json:"account_id" format:"uuid"`
	// The channel the message arrived on, for example sms or whatsapp.
	Channel string `json:"channel"`
	// The contact's number in E.164 format, meaning the number the message came from.
	InboundNumber string `json:"inbound_number"`
	// The inbound message.
	MessageID string `json:"message_id" format:"uuid"`
	// Your number in E.164 format, meaning the number the message was addressed to.
	OutboundNumber string `json:"outbound_number"`
	// When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ).
	ReceivedAt string `json:"received_at"`
	// The message body. Sent as null when the inbound message carried no text, for
	// example a media-only message. The field is always present, so read it and check
	// for null rather than checking whether the key exists.
	Text string `json:"text" api:"nullable"`
	// When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ). Same value as
	// ReceivedAt, kept for envelope consistency with outbound events.
	UpdatedAt string `json:"updated_at"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountID      respjson.Field
		Channel        respjson.Field
		InboundNumber  respjson.Field
		MessageID      respjson.Field
		OutboundNumber respjson.Field
		ReceivedAt     respjson.Field
		Text           respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Body of a message.received event. Delivered when a contact messages one of your numbers.

func (InboundMessageEventPayload) RawJSON added in v0.31.0

func (r InboundMessageEventPayload) RawJSON() string

Returns the unmodified JSON received from the API

func (*InboundMessageEventPayload) UnmarshalJSON added in v0.31.0

func (r *InboundMessageEventPayload) UnmarshalJSON(data []byte) error

type MeGetParams added in v0.8.0

type MeGetParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type MeGetResponse added in v0.7.0

type MeGetResponse struct {
	// Account response for GET /v3/me endpoint. Returns organization (with profiles),
	// user (standalone), or profile (child of an organization) data depending on the
	// API key type. Always includes messaging channel configuration.
	Data MeGetResponseData `json:"data" api:"nullable"`
	// Error information
	Error MeGetResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta MeGetResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (MeGetResponse) RawJSON added in v0.7.0

func (r MeGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MeGetResponse) UnmarshalJSON added in v0.7.0

func (r *MeGetResponse) UnmarshalJSON(data []byte) error

type MeGetResponseData added in v0.7.0

type MeGetResponseData struct {
	// Customer ID (organization, account, or profile)
	ID string `json:"id" format:"uuid"`
	// Messaging channel configuration. All three channels are always present. Each
	// channel has a "configured" flag; configured channels expose additional details.
	Channels MeGetResponseDataChannels `json:"channels"`
	// When the account was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Account description
	Description string `json:"description" api:"nullable"`
	// Contact email address
	Email string `json:"email" api:"nullable"`
	// Account icon URL
	Icon string `json:"icon" api:"nullable"`
	// Account name
	Name string `json:"name"`
	// Organization ID (only for profile type — the parent organization)
	OrganizationID string `json:"organization_id" api:"nullable" format:"uuid"`
	// List of profiles (populated for organization type, empty for user and profile
	// types)
	Profiles []MeGetResponseDataProfile `json:"profiles"`
	// Profile configuration settings
	Settings MeGetResponseDataSettings `json:"settings" api:"nullable"`
	// Short name / abbreviation (only for profile type)
	ShortName string `json:"short_name" api:"nullable"`
	// Profile status (only for profile type): incomplete, pending_review, approved,
	// etc.
	Status string `json:"status" api:"nullable"`
	// Account type: "organization" (has profiles), "user" (no profiles), or "profile"
	// (child of an organization)
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Channels       respjson.Field
		CreatedAt      respjson.Field
		Description    respjson.Field
		Email          respjson.Field
		Icon           respjson.Field
		Name           respjson.Field
		OrganizationID respjson.Field
		Profiles       respjson.Field
		Settings       respjson.Field
		ShortName      respjson.Field
		Status         respjson.Field
		Type           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Account response for GET /v3/me endpoint. Returns organization (with profiles), user (standalone), or profile (child of an organization) data depending on the API key type. Always includes messaging channel configuration.

func (MeGetResponseData) RawJSON added in v0.7.0

func (r MeGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*MeGetResponseData) UnmarshalJSON added in v0.7.0

func (r *MeGetResponseData) UnmarshalJSON(data []byte) error

type MeGetResponseDataChannels added in v0.8.0

type MeGetResponseDataChannels struct {
	// RCS channel configuration. When configured, includes the RCS phone number.
	Rcs MeGetResponseDataChannelsRcs `json:"rcs"`
	// SMS channel configuration. When configured, includes the sending phone number.
	SMS MeGetResponseDataChannelsSMS `json:"sms"`
	// WhatsApp Business channel configuration. When configured, includes the WhatsApp
	// phone number and business name.
	Whatsapp MeGetResponseDataChannelsWhatsapp `json:"whatsapp"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Rcs         respjson.Field
		SMS         respjson.Field
		Whatsapp    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Messaging channel configuration. All three channels are always present. Each channel has a "configured" flag; configured channels expose additional details.

func (MeGetResponseDataChannels) RawJSON added in v0.8.0

func (r MeGetResponseDataChannels) RawJSON() string

Returns the unmodified JSON received from the API

func (*MeGetResponseDataChannels) UnmarshalJSON added in v0.8.0

func (r *MeGetResponseDataChannels) UnmarshalJSON(data []byte) error

type MeGetResponseDataChannelsRcs added in v0.8.0

type MeGetResponseDataChannelsRcs struct {
	// Whether RCS is configured for this account
	Configured bool `json:"configured"`
	// RCS-enabled phone number in E.164 format
	PhoneNumber string `json:"phone_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Configured  respjson.Field
		PhoneNumber respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

RCS channel configuration. When configured, includes the RCS phone number.

func (MeGetResponseDataChannelsRcs) RawJSON added in v0.8.0

Returns the unmodified JSON received from the API

func (*MeGetResponseDataChannelsRcs) UnmarshalJSON added in v0.8.0

func (r *MeGetResponseDataChannelsRcs) UnmarshalJSON(data []byte) error

type MeGetResponseDataChannelsSMS added in v0.8.0

type MeGetResponseDataChannelsSMS struct {
	// Whether SMS is configured for this account
	Configured bool `json:"configured"`
	// Sending phone number in E.164 format
	PhoneNumber string `json:"phone_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Configured  respjson.Field
		PhoneNumber respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

SMS channel configuration. When configured, includes the sending phone number.

func (MeGetResponseDataChannelsSMS) RawJSON added in v0.8.0

Returns the unmodified JSON received from the API

func (*MeGetResponseDataChannelsSMS) UnmarshalJSON added in v0.8.0

func (r *MeGetResponseDataChannelsSMS) UnmarshalJSON(data []byte) error

type MeGetResponseDataChannelsWhatsapp added in v0.8.0

type MeGetResponseDataChannelsWhatsapp struct {
	// WhatsApp Business display name
	BusinessName string `json:"business_name" api:"nullable"`
	// Whether WhatsApp is configured for this account
	Configured bool `json:"configured"`
	// WhatsApp phone number in E.164 format
	PhoneNumber string `json:"phone_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BusinessName respjson.Field
		Configured   respjson.Field
		PhoneNumber  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WhatsApp Business channel configuration. When configured, includes the WhatsApp phone number and business name.

func (MeGetResponseDataChannelsWhatsapp) RawJSON added in v0.8.0

Returns the unmodified JSON received from the API

func (*MeGetResponseDataChannelsWhatsapp) UnmarshalJSON added in v0.8.0

func (r *MeGetResponseDataChannelsWhatsapp) UnmarshalJSON(data []byte) error

type MeGetResponseDataProfile added in v0.7.0

type MeGetResponseDataProfile struct {
	// Profile unique identifier
	ID string `json:"id" format:"uuid"`
	// When the profile was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Profile description
	Description string `json:"description" api:"nullable"`
	// Profile icon URL
	Icon string `json:"icon" api:"nullable"`
	// Profile name
	Name string `json:"name"`
	// User's role in this profile: admin, billing, developer (inherited from
	// organization if not explicitly set)
	Role string `json:"role" api:"nullable"`
	// Profile configuration settings
	Settings MeGetResponseDataProfileSettings `json:"settings"`
	// Profile short name (abbreviation)
	ShortName string `json:"short_name" api:"nullable"`
	// Profile setup status: incomplete, pending_review, approved, rejected
	Status string `json:"status" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Description respjson.Field
		Icon        respjson.Field
		Name        respjson.Field
		Role        respjson.Field
		Settings    respjson.Field
		ShortName   respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Profile (sender profile) response for v3 API

func (MeGetResponseDataProfile) RawJSON added in v0.7.0

func (r MeGetResponseDataProfile) RawJSON() string

Returns the unmodified JSON received from the API

func (*MeGetResponseDataProfile) UnmarshalJSON added in v0.7.0

func (r *MeGetResponseDataProfile) UnmarshalJSON(data []byte) error

type MeGetResponseDataProfileSettings added in v0.23.0

type MeGetResponseDataProfileSettings struct {
	// Always false. A profile no longer shares contacts with sibling profiles — it
	// sees only what it owns. Retained so existing v3 clients reading
	// allow_contact_sharing keep deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowContactSharing bool `json:"allow_contact_sharing" api:"nullable"`
	// Always false. A profile no longer shares templates with sibling profiles.
	// Retained so existing v3 clients reading allow_template_sharing keep
	// deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowTemplateSharing bool `json:"allow_template_sharing" api:"nullable"`
	// Billing model: profile, organization, or profile_and_organization
	BillingModel string `json:"billing_model" api:"nullable"`
	// Always false. A profile no longer inherits its organization's contacts. Retained
	// so existing v3 clients reading inherit_contacts keep deserializing; it carries
	// no information.
	//
	// Deprecated: deprecated
	InheritContacts bool `json:"inherit_contacts" api:"nullable"`
	// Whether this profile inherits TCR brand from the organization
	InheritTcrBrand bool `json:"inherit_tcr_brand" api:"nullable"`
	// Whether this profile inherits TCR campaign from the organization
	InheritTcrCampaign bool `json:"inherit_tcr_campaign" api:"nullable"`
	// Always false. A profile no longer inherits its organization's templates.
	// Retained so existing v3 clients reading inherit_templates keep deserializing; it
	// carries no information.
	//
	// Deprecated: deprecated
	InheritTemplates bool `json:"inherit_templates" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowContactSharing  respjson.Field
		AllowTemplateSharing respjson.Field
		BillingModel         respjson.Field
		InheritContacts      respjson.Field
		InheritTcrBrand      respjson.Field
		InheritTcrCampaign   respjson.Field
		InheritTemplates     respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Profile configuration settings

func (MeGetResponseDataProfileSettings) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*MeGetResponseDataProfileSettings) UnmarshalJSON added in v0.23.0

func (r *MeGetResponseDataProfileSettings) UnmarshalJSON(data []byte) error

type MeGetResponseDataSettings added in v0.23.0

type MeGetResponseDataSettings struct {
	// Always false. A profile no longer shares contacts with sibling profiles — it
	// sees only what it owns. Retained so existing v3 clients reading
	// allow_contact_sharing keep deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowContactSharing bool `json:"allow_contact_sharing" api:"nullable"`
	// Always false. A profile no longer shares templates with sibling profiles.
	// Retained so existing v3 clients reading allow_template_sharing keep
	// deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowTemplateSharing bool `json:"allow_template_sharing" api:"nullable"`
	// Billing model: profile, organization, or profile_and_organization
	BillingModel string `json:"billing_model" api:"nullable"`
	// Always false. A profile no longer inherits its organization's contacts. Retained
	// so existing v3 clients reading inherit_contacts keep deserializing; it carries
	// no information.
	//
	// Deprecated: deprecated
	InheritContacts bool `json:"inherit_contacts" api:"nullable"`
	// Whether this profile inherits TCR brand from the organization
	InheritTcrBrand bool `json:"inherit_tcr_brand" api:"nullable"`
	// Whether this profile inherits TCR campaign from the organization
	InheritTcrCampaign bool `json:"inherit_tcr_campaign" api:"nullable"`
	// Always false. A profile no longer inherits its organization's templates.
	// Retained so existing v3 clients reading inherit_templates keep deserializing; it
	// carries no information.
	//
	// Deprecated: deprecated
	InheritTemplates bool `json:"inherit_templates" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowContactSharing  respjson.Field
		AllowTemplateSharing respjson.Field
		BillingModel         respjson.Field
		InheritContacts      respjson.Field
		InheritTcrBrand      respjson.Field
		InheritTcrCampaign   respjson.Field
		InheritTemplates     respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Profile configuration settings

func (MeGetResponseDataSettings) RawJSON added in v0.23.0

func (r MeGetResponseDataSettings) RawJSON() string

Returns the unmodified JSON received from the API

func (*MeGetResponseDataSettings) UnmarshalJSON added in v0.23.0

func (r *MeGetResponseDataSettings) UnmarshalJSON(data []byte) error

type MeGetResponseError added in v0.23.0

type MeGetResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (MeGetResponseError) RawJSON added in v0.23.0

func (r MeGetResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*MeGetResponseError) UnmarshalJSON added in v0.23.0

func (r *MeGetResponseError) UnmarshalJSON(data []byte) error

type MeGetResponseMeta added in v0.23.0

type MeGetResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (MeGetResponseMeta) RawJSON added in v0.23.0

func (r MeGetResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*MeGetResponseMeta) UnmarshalJSON added in v0.23.0

func (r *MeGetResponseMeta) UnmarshalJSON(data []byte) error

type MeService added in v0.7.0

type MeService struct {
	Options []option.RequestOption
}

Who the current key is.

`GET /v3/me` answers with the account the key authenticates as, which is the quickest way to tell a live key from a test one, an organization key from a sender profile's, and to confirm `x-profile-id` resolved to the profile you meant.

MeService contains methods and other services that help with interacting with the Sent API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMeService method instead.

func NewMeService added in v0.7.0

func NewMeService(opts ...option.RequestOption) (r MeService)

NewMeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MeService) Get added in v0.7.0

func (r *MeService) Get(ctx context.Context, query MeGetParams, opts ...option.RequestOption) (res *MeGetResponse, err error)

Returns the account associated with the provided API key. The response includes account identity, contact information, messaging channel configuration, and — depending on the account type — either a list of child profiles or the profile's own settings.

**Account types:**

  • `organization` — Has child profiles. The `profiles` array is populated.
  • `user` — Standalone account with no profiles.
  • `profile` — Child of an organization. Includes `organization_id`, `short_name`, `status`, and `settings`.

**Channels:** The `channels` object always includes `sms`, `whatsapp`, and `rcs`. Each channel has a `configured` boolean. Configured channels expose additional details such as `phone_number`.

type MessageEvent added in v0.31.0

type MessageEvent struct {
	// The specific event within the family, for example message.delivered or
	// message.received. Absent on events that have no subtype, so treat it as
	// optional.
	Event string `json:"event" api:"nullable"`
	// The event family, for example message or templates. Route on this first, then on
	// event for the specific change.
	Field string `json:"field"`
	// Body of an outbound message lifecycle event. Delivered once per status change,
	// so a single message produces several of these as it moves toward a terminal
	// status.
	Payload MessageEventPayload `json:"payload" api:"nullable"`
	// When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
	// time, not the time the underlying change happened. Use the timestamp inside the
	// payload for the latter.
	Timestamp string `json:"timestamp"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Event       respjson.Field
		Field       respjson.Field
		Payload     respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and varies only in Payload.

func (MessageEvent) RawJSON added in v0.31.0

func (r MessageEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageEvent) UnmarshalJSON added in v0.31.0

func (r *MessageEvent) UnmarshalJSON(data []byte) error

type MessageEventPayload added in v0.31.0

type MessageEventPayload struct {
	// The account the message belongs to.
	AccountID string `json:"account_id" format:"uuid"`
	// The agent attributed to the send, when the send was attributed to one.
	AgentID string `json:"agent_id" api:"nullable"`
	// The channel the message went out on, for example sms or whatsapp. A message that
	// falls back to another channel reports the channel actually used.
	Channel string `json:"channel"`
	// The message this event describes. Stable across every event in the message's
	// lifecycle, so use it to correlate them.
	MessageID string `json:"message_id" format:"uuid"`
	// The status the message just reached, for example SENT, DELIVERED, or FAILED.
	// Sent means dispatched and delivered means confirmed, so treat them as distinct
	// outcomes.
	MessageStatus string `json:"message_status"`
	// The recipient's number in E.164 format.
	OutboundNumber string `json:"outbound_number"`
	// The template the message was sent from, when it was sent from one.
	TemplateID string `json:"template_id" api:"nullable" format:"uuid"`
	// Name of the template the message was sent from. Omitted when the message wasn't
	// template-based.
	TemplateName string `json:"template_name" api:"nullable"`
	// When the message reached MessageStatus, in UTC (yyyy-MM-ddTHH:mm:ssZ).
	UpdatedAt string `json:"updated_at"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountID      respjson.Field
		AgentID        respjson.Field
		Channel        respjson.Field
		MessageID      respjson.Field
		MessageStatus  respjson.Field
		OutboundNumber respjson.Field
		TemplateID     respjson.Field
		TemplateName   respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Body of an outbound message lifecycle event. Delivered once per status change, so a single message produces several of these as it moves toward a terminal status.

func (MessageEventPayload) RawJSON added in v0.31.0

func (r MessageEventPayload) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageEventPayload) UnmarshalJSON added in v0.31.0

func (r *MessageEventPayload) UnmarshalJSON(data []byte) error

type MessageGetActivitiesParams added in v0.8.0

type MessageGetActivitiesParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type MessageGetActivitiesResponse added in v0.7.0

type MessageGetActivitiesResponse struct {
	// Response for GET /messages/{id}/activities
	Data MessageGetActivitiesResponseData `json:"data" api:"nullable"`
	// Error information
	Error MessageGetActivitiesResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta MessageGetActivitiesResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (MessageGetActivitiesResponse) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*MessageGetActivitiesResponse) UnmarshalJSON added in v0.7.0

func (r *MessageGetActivitiesResponse) UnmarshalJSON(data []byte) error

type MessageGetActivitiesResponseData added in v0.7.0

type MessageGetActivitiesResponseData struct {
	// List of activity events ordered by most recent first
	Activities []MessageGetActivitiesResponseDataActivity `json:"activities"`
	// The message ID these activities belong to
	MessageID string `json:"message_id" format:"uuid"`
	// Pagination metadata for list responses
	Pagination MessageGetActivitiesResponseDataPagination `json:"pagination"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Activities  respjson.Field
		MessageID   respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response for GET /messages/{id}/activities

func (MessageGetActivitiesResponseData) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*MessageGetActivitiesResponseData) UnmarshalJSON added in v0.7.0

func (r *MessageGetActivitiesResponseData) UnmarshalJSON(data []byte) error

type MessageGetActivitiesResponseDataActivity added in v0.7.0

type MessageGetActivitiesResponseDataActivity struct {
	// Active contact markup applied on top of the channel cost, formatted to 4 decimal
	// places.
	ActiveContactPrice string `json:"active_contact_price" api:"nullable"`
	// Human-readable description of the activity
	Description string `json:"description"`
	// Sender phone number for this activity (the customer's sending number for
	// outbound, the external sender for inbound). Null when not reported by the
	// provider.
	From string `json:"from" api:"nullable"`
	// Channel cost for this activity (e.g., SMS/WhatsApp provider cost), formatted to
	// 4 decimal places.
	Price string `json:"price" api:"nullable"`
	// Activity status. Outbound: QUEUED, PROCESSED, ROUTED, SENT, DELIVERED, READ,
	// FAILED. Inbound (from contact): RECEIVED (terminal).
	Status string `json:"status"`
	// When this activity occurred
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActiveContactPrice respjson.Field
		Description        respjson.Field
		From               respjson.Field
		Price              respjson.Field
		Status             respjson.Field
		Timestamp          respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A single message activity event for v3 API

func (MessageGetActivitiesResponseDataActivity) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*MessageGetActivitiesResponseDataActivity) UnmarshalJSON added in v0.7.0

func (r *MessageGetActivitiesResponseDataActivity) UnmarshalJSON(data []byte) error

type MessageGetActivitiesResponseDataPagination added in v0.32.0

type MessageGetActivitiesResponseDataPagination struct {
	// Cursor-based pagination. Never populated — see Cursors.
	//
	// Deprecated: deprecated
	Cursors MessageGetActivitiesResponseDataPaginationCursors `json:"cursors" api:"nullable"`
	// Whether there are more pages after this one
	HasMore bool `json:"has_more"`
	// Current page number (1-indexed)
	Page int64 `json:"page"`
	// Number of items per page
	PageSize int64 `json:"page_size"`
	// Total number of items across all pages
	TotalCount int64 `json:"total_count"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cursors     respjson.Field
		HasMore     respjson.Field
		Page        respjson.Field
		PageSize    respjson.Field
		TotalCount  respjson.Field
		TotalPages  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata for list responses

func (MessageGetActivitiesResponseDataPagination) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*MessageGetActivitiesResponseDataPagination) UnmarshalJSON added in v0.32.0

func (r *MessageGetActivitiesResponseDataPagination) UnmarshalJSON(data []byte) error

type MessageGetActivitiesResponseDataPaginationCursors deprecated added in v0.32.0

type MessageGetActivitiesResponseDataPaginationCursors struct {
	// Cursor to fetch the next page.
	After string `json:"after" api:"nullable"`
	// Cursor to fetch the previous page.
	Before string `json:"before" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cursor-based pagination. Never populated — see Cursors.

Deprecated: deprecated

func (MessageGetActivitiesResponseDataPaginationCursors) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*MessageGetActivitiesResponseDataPaginationCursors) UnmarshalJSON added in v0.32.0

type MessageGetActivitiesResponseError added in v0.23.0

type MessageGetActivitiesResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (MessageGetActivitiesResponseError) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*MessageGetActivitiesResponseError) UnmarshalJSON added in v0.23.0

func (r *MessageGetActivitiesResponseError) UnmarshalJSON(data []byte) error

type MessageGetActivitiesResponseMeta added in v0.23.0

type MessageGetActivitiesResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (MessageGetActivitiesResponseMeta) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*MessageGetActivitiesResponseMeta) UnmarshalJSON added in v0.23.0

func (r *MessageGetActivitiesResponseMeta) UnmarshalJSON(data []byte) error

type MessageGetStatusParams added in v0.8.0

type MessageGetStatusParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type MessageGetStatusResponse added in v0.7.0

type MessageGetStatusResponse struct {
	// Message response for v3 API — same shape as v2 with snake_case JSON conventions
	Data MessageGetStatusResponseData `json:"data" api:"nullable"`
	// Error information
	Error MessageGetStatusResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta MessageGetStatusResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (MessageGetStatusResponse) RawJSON added in v0.7.0

func (r MessageGetStatusResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageGetStatusResponse) UnmarshalJSON added in v0.7.0

func (r *MessageGetStatusResponse) UnmarshalJSON(data []byte) error

type MessageGetStatusResponseData added in v0.7.0

type MessageGetStatusResponseData struct {
	ID                 string                              `json:"id" format:"uuid"`
	ActiveContactPrice float64                             `json:"active_contact_price" api:"nullable" format:"decimal"`
	Channel            string                              `json:"channel"`
	ContactID          string                              `json:"contact_id" format:"uuid"`
	CreatedAt          time.Time                           `json:"created_at" format:"date-time"`
	CustomerID         string                              `json:"customer_id" format:"uuid"`
	Direction          string                              `json:"direction"`
	Events             []MessageGetStatusResponseDataEvent `json:"events" api:"nullable"`
	// Structured message body format for database storage. Preserves channel-specific
	// components (header, body, footer, buttons).
	MessageBody        MessageGetStatusResponseDataMessageBody `json:"message_body" api:"nullable"`
	Phone              string                                  `json:"phone"`
	PhoneInternational string                                  `json:"phone_international"`
	Price              float64                                 `json:"price" api:"nullable" format:"decimal"`
	RegionCode         string                                  `json:"region_code"`
	Status             string                                  `json:"status"`
	TemplateCategory   string                                  `json:"template_category" api:"nullable"`
	TemplateID         string                                  `json:"template_id" api:"nullable" format:"uuid"`
	TemplateName       string                                  `json:"template_name" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		ActiveContactPrice respjson.Field
		Channel            respjson.Field
		ContactID          respjson.Field
		CreatedAt          respjson.Field
		CustomerID         respjson.Field
		Direction          respjson.Field
		Events             respjson.Field
		MessageBody        respjson.Field
		Phone              respjson.Field
		PhoneInternational respjson.Field
		Price              respjson.Field
		RegionCode         respjson.Field
		Status             respjson.Field
		TemplateCategory   respjson.Field
		TemplateID         respjson.Field
		TemplateName       respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Message response for v3 API — same shape as v2 with snake_case JSON conventions

func (MessageGetStatusResponseData) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*MessageGetStatusResponseData) UnmarshalJSON added in v0.7.0

func (r *MessageGetStatusResponseData) UnmarshalJSON(data []byte) error

type MessageGetStatusResponseDataEvent added in v0.7.0

type MessageGetStatusResponseDataEvent struct {
	Status      string    `json:"status" api:"required"`
	Timestamp   time.Time `json:"timestamp" api:"required" format:"date-time"`
	Description string    `json:"description" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		Timestamp   respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a status change event in a message's lifecycle (v3)

func (MessageGetStatusResponseDataEvent) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*MessageGetStatusResponseDataEvent) UnmarshalJSON added in v0.7.0

func (r *MessageGetStatusResponseDataEvent) UnmarshalJSON(data []byte) error

type MessageGetStatusResponseDataMessageBody added in v0.7.0

type MessageGetStatusResponseDataMessageBody struct {
	Buttons []MessageGetStatusResponseDataMessageBodyButton `json:"buttons" api:"nullable"`
	Content string                                          `json:"content"`
	Footer  string                                          `json:"footer" api:"nullable"`
	Header  string                                          `json:"header" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Buttons     respjson.Field
		Content     respjson.Field
		Footer      respjson.Field
		Header      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured message body format for database storage. Preserves channel-specific components (header, body, footer, buttons).

func (MessageGetStatusResponseDataMessageBody) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*MessageGetStatusResponseDataMessageBody) UnmarshalJSON added in v0.7.0

func (r *MessageGetStatusResponseDataMessageBody) UnmarshalJSON(data []byte) error

type MessageGetStatusResponseDataMessageBodyButton added in v0.7.0

type MessageGetStatusResponseDataMessageBodyButton struct {
	PostbackData string `json:"postbackData" api:"nullable"`
	Text         string `json:"text" api:"nullable"`
	Type         string `json:"type"`
	Value        string `json:"value"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PostbackData respjson.Field
		Text         respjson.Field
		Type         respjson.Field
		Value        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageGetStatusResponseDataMessageBodyButton) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*MessageGetStatusResponseDataMessageBodyButton) UnmarshalJSON added in v0.7.0

func (r *MessageGetStatusResponseDataMessageBodyButton) UnmarshalJSON(data []byte) error

type MessageGetStatusResponseError added in v0.23.0

type MessageGetStatusResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (MessageGetStatusResponseError) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*MessageGetStatusResponseError) UnmarshalJSON added in v0.23.0

func (r *MessageGetStatusResponseError) UnmarshalJSON(data []byte) error

type MessageGetStatusResponseMeta added in v0.23.0

type MessageGetStatusResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (MessageGetStatusResponseMeta) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*MessageGetStatusResponseMeta) UnmarshalJSON added in v0.23.0

func (r *MessageGetStatusResponseMeta) UnmarshalJSON(data []byte) error

type MessageSendParams added in v0.7.0

type MessageSendParams struct {
	// Plain-text (free-form) message body. Provide either Template or this.
	Text param.Opt[string] `json:"text,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// Channels to broadcast on, e.g. ["whatsapp", "sms"]. Each channel produces a
	// separate message per recipient. "sent" = auto-detect. Defaults to ["sent"]
	// (auto-detect) if omitted.
	Channel []string `json:"channel,omitzero"`
	// SDK-style template reference: resolve by ID or by name, with optional
	// parameters.
	Template MessageSendParamsTemplate `json:"template,omitzero"`
	// List of recipient phone numbers in E.164 format (multi-recipient fan-out)
	To []string `json:"to,omitzero"`
	// contains filtered or unexported fields
}

func (MessageSendParams) MarshalJSON added in v0.7.0

func (r MessageSendParams) MarshalJSON() (data []byte, err error)

func (*MessageSendParams) UnmarshalJSON added in v0.7.0

func (r *MessageSendParams) UnmarshalJSON(data []byte) error

type MessageSendParamsTemplate added in v0.7.0

type MessageSendParamsTemplate struct {
	// Template ID (mutually exclusive with name)
	ID param.Opt[string] `json:"id,omitzero" format:"uuid"`
	// Template name (mutually exclusive with id)
	Name param.Opt[string] `json:"name,omitzero"`
	// Template variable parameters for personalization
	Parameters map[string]string `json:"parameters,omitzero"`
	// contains filtered or unexported fields
}

SDK-style template reference: resolve by ID or by name, with optional parameters.

func (MessageSendParamsTemplate) MarshalJSON added in v0.7.0

func (r MessageSendParamsTemplate) MarshalJSON() (data []byte, err error)

func (*MessageSendParamsTemplate) UnmarshalJSON added in v0.7.0

func (r *MessageSendParamsTemplate) UnmarshalJSON(data []byte) error

type MessageSendResponse added in v0.7.0

type MessageSendResponse struct {
	// The result of a multi-recipient send.
	//
	// Declared here rather than in the service layer. POST /v3/messages used to
	// publish MessageSendResult — a type in Common.Services.Messaging.Contracts — so
	// the public contract was whatever the send service happened to return, and
	// changing that service for an internal reason changed the API. The service keeps
	// its result; this is what a caller sees, and the mapping between them is a
	// decision the endpoint makes.
	//
	// The wire is unchanged by the move: same names, same values.
	Data MessageSendResponseData `json:"data" api:"nullable"`
	// Error information
	Error MessageSendResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta MessageSendResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (MessageSendResponse) RawJSON added in v0.7.0

func (r MessageSendResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageSendResponse) UnmarshalJSON added in v0.7.0

func (r *MessageSendResponse) UnmarshalJSON(data []byte) error

type MessageSendResponseData added in v0.7.0

type MessageSendResponseData struct {
	Recipients []MessageSendResponseDataRecipient `json:"recipients"`
	// Overall status — QUEUED once the batch is accepted for delivery.
	Status       string `json:"status"`
	TemplateID   string `json:"template_id" format:"uuid"`
	TemplateName string `json:"template_name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Recipients   respjson.Field
		Status       respjson.Field
		TemplateID   respjson.Field
		TemplateName respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The result of a multi-recipient send.

Declared here rather than in the service layer. POST /v3/messages used to publish MessageSendResult — a type in Common.Services.Messaging.Contracts — so the public contract was whatever the send service happened to return, and changing that service for an internal reason changed the API. The service keeps its result; this is what a caller sees, and the mapping between them is a decision the endpoint makes.

The wire is unchanged by the move: same names, same values.

func (MessageSendResponseData) RawJSON added in v0.7.0

func (r MessageSendResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageSendResponseData) UnmarshalJSON added in v0.7.0

func (r *MessageSendResponseData) UnmarshalJSON(data []byte) error

type MessageSendResponseDataRecipient added in v0.7.0

type MessageSendResponseDataRecipient struct {
	// Resolved template body for this recipient's channel, or null when the channel is
	// auto-detected.
	Body string `json:"body" api:"nullable"`
	// Channel this message will be sent on — sms, whatsapp — or null to auto-detect.
	Channel string `json:"channel" api:"nullable"`
	// Identifier for tracking this recipient's message.
	MessageID string `json:"message_id" format:"uuid"`
	// Phone number in E.164 format.
	To string `json:"to"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Body        respjson.Field
		Channel     respjson.Field
		MessageID   respjson.Field
		To          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

What one recipient of a send got, as the API reports it.

func (MessageSendResponseDataRecipient) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*MessageSendResponseDataRecipient) UnmarshalJSON added in v0.7.0

func (r *MessageSendResponseDataRecipient) UnmarshalJSON(data []byte) error

type MessageSendResponseError added in v0.23.0

type MessageSendResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (MessageSendResponseError) RawJSON added in v0.23.0

func (r MessageSendResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageSendResponseError) UnmarshalJSON added in v0.23.0

func (r *MessageSendResponseError) UnmarshalJSON(data []byte) error

type MessageSendResponseMeta added in v0.23.0

type MessageSendResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (MessageSendResponseMeta) RawJSON added in v0.23.0

func (r MessageSendResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageSendResponseMeta) UnmarshalJSON added in v0.23.0

func (r *MessageSendResponseMeta) UnmarshalJSON(data []byte) error

type MessageService

type MessageService struct {
	Options []option.RequestOption
}

Send a message and follow what happened to it.

One endpoint sends on any channel: pass `channel: "sent"` and we pick between SMS, WhatsApp and RCS per recipient using your routing rules, or name a channel to pin it. A send is accepted asynchronously — `POST /v3/messages` returns an id, and delivery is reported through `GET /v3/messages/{id}`, its activities, or a webhook.

**A message needs a sender.** What you can send, where, and at what cost is decided by the markets under **Channels** — so a recipient in a country you hold no sender for is refused here rather than queued.

MessageService contains methods and other services that help with interacting with the Sent API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMessageService method instead.

func NewMessageService

func NewMessageService(opts ...option.RequestOption) (r MessageService)

NewMessageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MessageService) GetActivities added in v0.7.0

Retrieves the activity log for a specific message. Activities track the message lifecycle including acceptance, processing, sending, delivery, and any errors.

func (*MessageService) GetStatus added in v0.7.0

Retrieves the current status and details of a message by ID. Includes delivery status, timestamps, and error information if applicable.

func (*MessageService) Send added in v0.7.0

Sends a message to one or more recipients using a template. Supports multi-channel broadcast — when multiple channels are specified (e.g. ["sms", "whatsapp"]), a separate message is created for each (recipient, channel) pair. Returns immediately with per-recipient message IDs for async tracking via webhooks or the GET /messages/{id} endpoint. Sends gated before any delivery attempt do not reject the request — an account-level precondition such as insufficient balance, a template not approved for sending, or free-form content with no open conversation with the contact. The send is accepted with 202 and the affected messages are reported as BLOCKED on GET /messages/{id} and the message.blocked webhook.

type MessagingUseCaseUs added in v0.7.0

type MessagingUseCaseUs string
const (
	MessagingUseCaseUsMarketing                 MessagingUseCaseUs = "MARKETING"
	MessagingUseCaseUsAccountNotification       MessagingUseCaseUs = "ACCOUNT_NOTIFICATION"
	MessagingUseCaseUsCustomerCare              MessagingUseCaseUs = "CUSTOMER_CARE"
	MessagingUseCaseUsFraudAlert                MessagingUseCaseUs = "FRAUD_ALERT"
	MessagingUseCaseUsTwoFa                     MessagingUseCaseUs = "TWO_FA"
	MessagingUseCaseUsDeliveryNotification      MessagingUseCaseUs = "DELIVERY_NOTIFICATION"
	MessagingUseCaseUsSecurityAlert             MessagingUseCaseUs = "SECURITY_ALERT"
	MessagingUseCaseUsM2M                       MessagingUseCaseUs = "M2M"
	MessagingUseCaseUsMixed                     MessagingUseCaseUs = "MIXED"
	MessagingUseCaseUsHigherEducation           MessagingUseCaseUs = "HIGHER_EDUCATION"
	MessagingUseCaseUsPollingVoting             MessagingUseCaseUs = "POLLING_VOTING"
	MessagingUseCaseUsPublicServiceAnnouncement MessagingUseCaseUs = "PUBLIC_SERVICE_ANNOUNCEMENT"
	MessagingUseCaseUsLowVolume                 MessagingUseCaseUs = "LOW_VOLUME"
)

type NumberLookupParams added in v0.9.0

type NumberLookupParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type NumberLookupResponse added in v0.9.0

type NumberLookupResponse struct {
	// The response data (null if error)
	Data NumberLookupResponseData `json:"data" api:"nullable"`
	// Error information
	Error NumberLookupResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta NumberLookupResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (NumberLookupResponse) RawJSON added in v0.9.0

func (r NumberLookupResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NumberLookupResponse) UnmarshalJSON added in v0.9.0

func (r *NumberLookupResponse) UnmarshalJSON(data []byte) error

type NumberLookupResponseData added in v0.9.0

type NumberLookupResponseData struct {
	CarrierName       string `json:"carrier_name" api:"nullable"`
	CountryCode       string `json:"country_code" api:"nullable"`
	IsPorted          bool   `json:"is_ported" api:"nullable"`
	IsValid           bool   `json:"is_valid"`
	IsVoip            bool   `json:"is_voip" api:"nullable"`
	LineType          string `json:"line_type" api:"nullable"`
	MobileCountryCode string `json:"mobile_country_code" api:"nullable"`
	MobileNetworkCode string `json:"mobile_network_code" api:"nullable"`
	PhoneNumber       string `json:"phone_number"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CarrierName       respjson.Field
		CountryCode       respjson.Field
		IsPorted          respjson.Field
		IsValid           respjson.Field
		IsVoip            respjson.Field
		LineType          respjson.Field
		MobileCountryCode respjson.Field
		MobileNetworkCode respjson.Field
		PhoneNumber       respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The response data (null if error)

func (NumberLookupResponseData) RawJSON added in v0.9.0

func (r NumberLookupResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*NumberLookupResponseData) UnmarshalJSON added in v0.9.0

func (r *NumberLookupResponseData) UnmarshalJSON(data []byte) error

type NumberLookupResponseError added in v0.23.0

type NumberLookupResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (NumberLookupResponseError) RawJSON added in v0.23.0

func (r NumberLookupResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*NumberLookupResponseError) UnmarshalJSON added in v0.23.0

func (r *NumberLookupResponseError) UnmarshalJSON(data []byte) error

type NumberLookupResponseMeta added in v0.23.0

type NumberLookupResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (NumberLookupResponseMeta) RawJSON added in v0.23.0

func (r NumberLookupResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*NumberLookupResponseMeta) UnmarshalJSON added in v0.23.0

func (r *NumberLookupResponseMeta) UnmarshalJSON(data []byte) error

type NumberService added in v0.9.0

type NumberService struct {
	Options []option.RequestOption
}

What a phone number actually is, before you send to it.

A lookup returns the number's country, line type and carrier, which is what decides whether it is reachable on a channel and what it costs. Worth doing on import rather than on send: a landline in a contact list is a message that can never be delivered.

NumberService contains methods and other services that help with interacting with the Sent API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNumberService method instead.

func NewNumberService added in v0.9.0

func NewNumberService(opts ...option.RequestOption) (r NumberService)

NewNumberService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*NumberService) Lookup added in v0.9.0

func (r *NumberService) Lookup(ctx context.Context, phoneNumber string, query NumberLookupParams, opts ...option.RequestOption) (res *NumberLookupResponse, err error)

Retrieves detailed information about a phone number including carrier, line type, porting status, and VoIP detection. Uses the customer's messaging provider for rich data, with fallback to the internal index.

type ProfileCampaignDeleteParams added in v0.9.0

type ProfileCampaignDeleteParams struct {
	ProfileID string `path:"profileId" api:"required" format:"uuid" json:"-"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox    param.Opt[bool]   `json:"sandbox,omitzero"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ProfileCampaignDeleteParams) MarshalJSON added in v0.9.0

func (r ProfileCampaignDeleteParams) MarshalJSON() (data []byte, err error)

func (*ProfileCampaignDeleteParams) UnmarshalJSON added in v0.9.0

func (r *ProfileCampaignDeleteParams) UnmarshalJSON(data []byte) error

type ProfileCampaignListParams added in v0.9.0

type ProfileCampaignListParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type ProfileCampaignListResponse added in v0.9.0

type ProfileCampaignListResponse struct {
	// The response data (null if error)
	Data []ProfileCampaignListResponseData `json:"data" api:"nullable"`
	// Error information
	Error ProfileCampaignListResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ProfileCampaignListResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ProfileCampaignListResponse) RawJSON added in v0.9.0

func (r ProfileCampaignListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileCampaignListResponse) UnmarshalJSON added in v0.9.0

func (r *ProfileCampaignListResponse) UnmarshalJSON(data []byte) error

type ProfileCampaignListResponseData added in v0.23.0

type ProfileCampaignListResponseData struct {
	ID         string    `json:"id" format:"uuid"`
	BilledDate time.Time `json:"billedDate" api:"nullable" format:"date-time"`
	BrandID    string    `json:"brandId" api:"nullable" format:"uuid"`
	Cost       float64   `json:"cost" api:"nullable" format:"decimal"`
	CreatedAt  time.Time `json:"createdAt" format:"date-time"`
	CustomerID string    `json:"customerId" format:"uuid"`
	// True once every carrier has completed its DCA election and the campaign is
	// operationally ready for traffic.
	DcaElectionsComplete    bool      `json:"dcaElectionsComplete" api:"nullable"`
	DcaElectionsCompletedAt time.Time `json:"dcaElectionsCompletedAt" api:"nullable" format:"date-time"`
	Description             string    `json:"description"`
	// True when the one-time campaign submission fee has already been charged.
	HasSubmissionTransaction bool   `json:"hasSubmissionTransaction"`
	HelpKeywords             string `json:"helpKeywords" api:"nullable"`
	HelpMessage              string `json:"helpMessage" api:"nullable"`
	MessageFlow              string `json:"messageFlow" api:"nullable"`
	Name                     string `json:"name"`
	OptinKeywords            string `json:"optinKeywords" api:"nullable"`
	OptinMessage             string `json:"optinMessage" api:"nullable"`
	OptoutKeywords           string `json:"optoutKeywords" api:"nullable"`
	OptoutMessage            string `json:"optoutMessage" api:"nullable"`
	PrivacyPolicyLink        string `json:"privacyPolicyLink" api:"nullable"`
	// Any of "SENT_CREATED", "ACTIVE", "EXPIRED".
	Status         string    `json:"status" api:"nullable"`
	SubmittedAt    time.Time `json:"submittedAt" api:"nullable" format:"date-time"`
	SubmittedToTcr bool      `json:"submittedToTCR"`
	// The Campaign Registry identifier, once the campaign has been accepted.
	TcrCampaignID string `json:"tcrCampaignId" api:"nullable"`
	// Surfaced so customers can see why a submission did not reach the registry.
	TcrSyncError           string `json:"tcrSyncError" api:"nullable"`
	TermsAndConditionsLink string `json:"termsAndConditionsLink" api:"nullable"`
	// Campaign type (for example KYC or App).
	Type      string                                   `json:"type"`
	UpdatedAt time.Time                                `json:"updatedAt" api:"nullable" format:"date-time"`
	UseCases  []ProfileCampaignListResponseDataUseCase `json:"useCases"`
	// Expected messaging volume for this campaign — customer-supplied on
	// create/update, and the input to both the TCR usecase classification (LOW_VOLUME
	// vs MIXED/specific) and the campaign fee tier. Surfaced so customers can read
	// back the value they set.
	Volume string `json:"volume" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		BilledDate               respjson.Field
		BrandID                  respjson.Field
		Cost                     respjson.Field
		CreatedAt                respjson.Field
		CustomerID               respjson.Field
		DcaElectionsComplete     respjson.Field
		DcaElectionsCompletedAt  respjson.Field
		Description              respjson.Field
		HasSubmissionTransaction respjson.Field
		HelpKeywords             respjson.Field
		HelpMessage              respjson.Field
		MessageFlow              respjson.Field
		Name                     respjson.Field
		OptinKeywords            respjson.Field
		OptinMessage             respjson.Field
		OptoutKeywords           respjson.Field
		OptoutMessage            respjson.Field
		PrivacyPolicyLink        respjson.Field
		Status                   respjson.Field
		SubmittedAt              respjson.Field
		SubmittedToTcr           respjson.Field
		TcrCampaignID            respjson.Field
		TcrSyncError             respjson.Field
		TermsAndConditionsLink   respjson.Field
		Type                     respjson.Field
		UpdatedAt                respjson.Field
		UseCases                 respjson.Field
		Volume                   respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A 10DLC campaign registered for a brand.

func (ProfileCampaignListResponseData) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignListResponseData) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignListResponseData) UnmarshalJSON(data []byte) error

type ProfileCampaignListResponseDataUseCase added in v0.23.0

type ProfileCampaignListResponseDataUseCase struct {
	ID         string    `json:"id" format:"uuid"`
	CampaignID string    `json:"campaignId" format:"uuid"`
	CreatedAt  time.Time `json:"createdAt" format:"date-time"`
	CustomerID string    `json:"customerId" format:"uuid"`
	// Any of "MARKETING", "ACCOUNT_NOTIFICATION", "CUSTOMER_CARE", "FRAUD_ALERT",
	// "TWO_FA", "DELIVERY_NOTIFICATION", "SECURITY_ALERT", "M2M", "MIXED",
	// "HIGHER_EDUCATION", "POLLING_VOTING", "PUBLIC_SERVICE_ANNOUNCEMENT",
	// "LOW_VOLUME".
	MessagingUseCaseUs MessagingUseCaseUs `json:"messagingUseCaseUs"`
	// Sample messages submitted to the registry for this use case.
	SampleMessages []string  `json:"sampleMessages"`
	UpdatedAt      time.Time `json:"updatedAt" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		CampaignID         respjson.Field
		CreatedAt          respjson.Field
		CustomerID         respjson.Field
		MessagingUseCaseUs respjson.Field
		SampleMessages     respjson.Field
		UpdatedAt          respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Customer-facing use-case representation for the public v3 campaign contract. Exists for the same reason as BrandCampaignV3Response: nesting the TcrCampaignUseCase database entity in a public response means any column added to that table silently becomes part of the customer-facing contract. This DTO is an explicit allowlist, so a new column stays invisible until it is added here on purpose. This mirrors exactly the fields the entity already serialized, so it removes nothing from the current response shape. It only closes the future-leak path.

func (ProfileCampaignListResponseDataUseCase) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignListResponseDataUseCase) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignListResponseDataUseCase) UnmarshalJSON(data []byte) error

type ProfileCampaignListResponseError added in v0.23.0

type ProfileCampaignListResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ProfileCampaignListResponseError) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignListResponseError) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignListResponseError) UnmarshalJSON(data []byte) error

type ProfileCampaignListResponseMeta added in v0.23.0

type ProfileCampaignListResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ProfileCampaignListResponseMeta) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignListResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignListResponseMeta) UnmarshalJSON(data []byte) error

type ProfileCampaignNewParams added in v0.9.0

type ProfileCampaignNewParams struct {
	// Campaign data for create or update operation
	Campaign ProfileCampaignNewParamsCampaign `json:"campaign,omitzero" api:"required"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ProfileCampaignNewParams) MarshalJSON added in v0.9.0

func (r ProfileCampaignNewParams) MarshalJSON() (data []byte, err error)

func (*ProfileCampaignNewParams) UnmarshalJSON added in v0.9.0

func (r *ProfileCampaignNewParams) UnmarshalJSON(data []byte) error

type ProfileCampaignNewParamsCampaign added in v0.23.0

type ProfileCampaignNewParamsCampaign struct {
	// Campaign description
	Description string `json:"description" api:"required"`
	// Campaign name
	Name string `json:"name" api:"required"`
	// Campaign type (e.g., "KYC", "App").
	//
	// Still required of a caller, and consulted by nothing. It named the signup path
	// that produced the campaign, was written to a column no query filters on, no TCR
	// payload carries and no fee or status decision reads, and is now defaulted at the
	// entity instead. It stays required so that a request which was valid before is
	// still valid — dropping it would be the client-visible change, not keeping it.
	Type string `json:"type" api:"required"`
	// List of use cases with sample messages
	UseCases []ProfileCampaignNewParamsCampaignUseCase `json:"useCases,omitzero" api:"required"`
	// Comma-separated keywords that trigger help message (e.g., "HELP, INFO, SUPPORT")
	HelpKeywords param.Opt[string] `json:"helpKeywords,omitzero"`
	// Message sent when user requests help
	HelpMessage param.Opt[string] `json:"helpMessage,omitzero"`
	// Description of how messages flow in the campaign
	MessageFlow param.Opt[string] `json:"messageFlow,omitzero"`
	// Comma-separated keywords that trigger opt-in (e.g., "YES, START, SUBSCRIBE")
	OptinKeywords param.Opt[string] `json:"optinKeywords,omitzero"`
	// Message sent when user opts in
	OptinMessage param.Opt[string] `json:"optinMessage,omitzero"`
	// Comma-separated keywords that trigger opt-out (e.g., "STOP, UNSUBSCRIBE, END")
	OptoutKeywords param.Opt[string] `json:"optoutKeywords,omitzero"`
	// Message sent when user opts out
	OptoutMessage param.Opt[string] `json:"optoutMessage,omitzero"`
	// URL to privacy policy
	PrivacyPolicyLink param.Opt[string] `json:"privacyPolicyLink,omitzero" format:"uri"`
	// URL to terms and conditions
	TermsAndConditionsLink param.Opt[string] `json:"termsAndConditionsLink,omitzero" format:"uri"`
	// Expected messaging volume for this campaign. Numeric string (e.g. "1999",
	// "5000"). Values below 2000 bill at the low-volume tier.
	Volume param.Opt[string] `json:"volume,omitzero"`
	// contains filtered or unexported fields
}

Campaign data for create or update operation

The properties Description, Name, Type, UseCases are required.

func (ProfileCampaignNewParamsCampaign) MarshalJSON added in v0.23.0

func (r ProfileCampaignNewParamsCampaign) MarshalJSON() (data []byte, err error)

func (*ProfileCampaignNewParamsCampaign) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignNewParamsCampaign) UnmarshalJSON(data []byte) error

type ProfileCampaignNewParamsCampaignUseCase added in v0.23.0

type ProfileCampaignNewParamsCampaignUseCase struct {
	// Any of "MARKETING", "ACCOUNT_NOTIFICATION", "CUSTOMER_CARE", "FRAUD_ALERT",
	// "TWO_FA", "DELIVERY_NOTIFICATION", "SECURITY_ALERT", "M2M", "MIXED",
	// "HIGHER_EDUCATION", "POLLING_VOTING", "PUBLIC_SERVICE_ANNOUNCEMENT",
	// "LOW_VOLUME".
	MessagingUseCaseUs MessagingUseCaseUs `json:"messagingUseCaseUs,omitzero" api:"required"`
	// Sample messages for this use case (1-5 messages, max 1024 characters each)
	SampleMessages []string `json:"sampleMessages,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Campaign use case with sample messages

The properties MessagingUseCaseUs, SampleMessages are required.

func (ProfileCampaignNewParamsCampaignUseCase) MarshalJSON added in v0.23.0

func (r ProfileCampaignNewParamsCampaignUseCase) MarshalJSON() (data []byte, err error)

func (*ProfileCampaignNewParamsCampaignUseCase) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignNewParamsCampaignUseCase) UnmarshalJSON(data []byte) error

type ProfileCampaignNewResponse added in v0.23.0

type ProfileCampaignNewResponse struct {
	// A 10DLC campaign registered for a brand.
	Data ProfileCampaignNewResponseData `json:"data" api:"nullable"`
	// Error information
	Error ProfileCampaignNewResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ProfileCampaignNewResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ProfileCampaignNewResponse) RawJSON added in v0.23.0

func (r ProfileCampaignNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileCampaignNewResponse) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignNewResponse) UnmarshalJSON(data []byte) error

type ProfileCampaignNewResponseData added in v0.23.0

type ProfileCampaignNewResponseData struct {
	ID         string    `json:"id" format:"uuid"`
	BilledDate time.Time `json:"billedDate" api:"nullable" format:"date-time"`
	BrandID    string    `json:"brandId" api:"nullable" format:"uuid"`
	Cost       float64   `json:"cost" api:"nullable" format:"decimal"`
	CreatedAt  time.Time `json:"createdAt" format:"date-time"`
	CustomerID string    `json:"customerId" format:"uuid"`
	// True once every carrier has completed its DCA election and the campaign is
	// operationally ready for traffic.
	DcaElectionsComplete    bool      `json:"dcaElectionsComplete" api:"nullable"`
	DcaElectionsCompletedAt time.Time `json:"dcaElectionsCompletedAt" api:"nullable" format:"date-time"`
	Description             string    `json:"description"`
	// True when the one-time campaign submission fee has already been charged.
	HasSubmissionTransaction bool   `json:"hasSubmissionTransaction"`
	HelpKeywords             string `json:"helpKeywords" api:"nullable"`
	HelpMessage              string `json:"helpMessage" api:"nullable"`
	MessageFlow              string `json:"messageFlow" api:"nullable"`
	Name                     string `json:"name"`
	OptinKeywords            string `json:"optinKeywords" api:"nullable"`
	OptinMessage             string `json:"optinMessage" api:"nullable"`
	OptoutKeywords           string `json:"optoutKeywords" api:"nullable"`
	OptoutMessage            string `json:"optoutMessage" api:"nullable"`
	PrivacyPolicyLink        string `json:"privacyPolicyLink" api:"nullable"`
	// Any of "SENT_CREATED", "ACTIVE", "EXPIRED".
	Status         string    `json:"status" api:"nullable"`
	SubmittedAt    time.Time `json:"submittedAt" api:"nullable" format:"date-time"`
	SubmittedToTcr bool      `json:"submittedToTCR"`
	// The Campaign Registry identifier, once the campaign has been accepted.
	TcrCampaignID string `json:"tcrCampaignId" api:"nullable"`
	// Surfaced so customers can see why a submission did not reach the registry.
	TcrSyncError           string `json:"tcrSyncError" api:"nullable"`
	TermsAndConditionsLink string `json:"termsAndConditionsLink" api:"nullable"`
	// Campaign type (for example KYC or App).
	Type      string                                  `json:"type"`
	UpdatedAt time.Time                               `json:"updatedAt" api:"nullable" format:"date-time"`
	UseCases  []ProfileCampaignNewResponseDataUseCase `json:"useCases"`
	// Expected messaging volume for this campaign — customer-supplied on
	// create/update, and the input to both the TCR usecase classification (LOW_VOLUME
	// vs MIXED/specific) and the campaign fee tier. Surfaced so customers can read
	// back the value they set.
	Volume string `json:"volume" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		BilledDate               respjson.Field
		BrandID                  respjson.Field
		Cost                     respjson.Field
		CreatedAt                respjson.Field
		CustomerID               respjson.Field
		DcaElectionsComplete     respjson.Field
		DcaElectionsCompletedAt  respjson.Field
		Description              respjson.Field
		HasSubmissionTransaction respjson.Field
		HelpKeywords             respjson.Field
		HelpMessage              respjson.Field
		MessageFlow              respjson.Field
		Name                     respjson.Field
		OptinKeywords            respjson.Field
		OptinMessage             respjson.Field
		OptoutKeywords           respjson.Field
		OptoutMessage            respjson.Field
		PrivacyPolicyLink        respjson.Field
		Status                   respjson.Field
		SubmittedAt              respjson.Field
		SubmittedToTcr           respjson.Field
		TcrCampaignID            respjson.Field
		TcrSyncError             respjson.Field
		TermsAndConditionsLink   respjson.Field
		Type                     respjson.Field
		UpdatedAt                respjson.Field
		UseCases                 respjson.Field
		Volume                   respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A 10DLC campaign registered for a brand.

func (ProfileCampaignNewResponseData) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignNewResponseData) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignNewResponseData) UnmarshalJSON(data []byte) error

type ProfileCampaignNewResponseDataUseCase added in v0.23.0

type ProfileCampaignNewResponseDataUseCase struct {
	ID         string    `json:"id" format:"uuid"`
	CampaignID string    `json:"campaignId" format:"uuid"`
	CreatedAt  time.Time `json:"createdAt" format:"date-time"`
	CustomerID string    `json:"customerId" format:"uuid"`
	// Any of "MARKETING", "ACCOUNT_NOTIFICATION", "CUSTOMER_CARE", "FRAUD_ALERT",
	// "TWO_FA", "DELIVERY_NOTIFICATION", "SECURITY_ALERT", "M2M", "MIXED",
	// "HIGHER_EDUCATION", "POLLING_VOTING", "PUBLIC_SERVICE_ANNOUNCEMENT",
	// "LOW_VOLUME".
	MessagingUseCaseUs MessagingUseCaseUs `json:"messagingUseCaseUs"`
	// Sample messages submitted to the registry for this use case.
	SampleMessages []string  `json:"sampleMessages"`
	UpdatedAt      time.Time `json:"updatedAt" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		CampaignID         respjson.Field
		CreatedAt          respjson.Field
		CustomerID         respjson.Field
		MessagingUseCaseUs respjson.Field
		SampleMessages     respjson.Field
		UpdatedAt          respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Customer-facing use-case representation for the public v3 campaign contract. Exists for the same reason as BrandCampaignV3Response: nesting the TcrCampaignUseCase database entity in a public response means any column added to that table silently becomes part of the customer-facing contract. This DTO is an explicit allowlist, so a new column stays invisible until it is added here on purpose. This mirrors exactly the fields the entity already serialized, so it removes nothing from the current response shape. It only closes the future-leak path.

func (ProfileCampaignNewResponseDataUseCase) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignNewResponseDataUseCase) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignNewResponseDataUseCase) UnmarshalJSON(data []byte) error

type ProfileCampaignNewResponseError added in v0.23.0

type ProfileCampaignNewResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ProfileCampaignNewResponseError) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignNewResponseError) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignNewResponseError) UnmarshalJSON(data []byte) error

type ProfileCampaignNewResponseMeta added in v0.23.0

type ProfileCampaignNewResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ProfileCampaignNewResponseMeta) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignNewResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignNewResponseMeta) UnmarshalJSON(data []byte) error

type ProfileCampaignService added in v0.9.0

type ProfileCampaignService struct {
	Options []option.RequestOption
}

**Deprecated — use Sender Profiles.**

The original profile resource, kept because it has live callers. It still works, and its replacement is `/v3/sender-profiles`, which takes the identity and the campaign in one call instead of across three.

New integrations should not start here.

ProfileCampaignService contains methods and other services that help with interacting with the Sent API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProfileCampaignService method instead.

func NewProfileCampaignService added in v0.9.0

func NewProfileCampaignService(opts ...option.RequestOption) (r ProfileCampaignService)

NewProfileCampaignService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProfileCampaignService) Delete deprecated added in v0.9.0

func (r *ProfileCampaignService) Delete(ctx context.Context, campaignID string, params ProfileCampaignDeleteParams, opts ...option.RequestOption) (err error)

**Deprecated.** This endpoint is replaced by `/v3/sender-profiles` and will be removed in a future release. It still behaves exactly as before, so nothing needs to change today — but new integrations should use `/v3/sender-profiles`, which models a profile's markets, compliance, brand, campaigns and billing explicitly.

Deletes a campaign by ID from the brand of the specified profile. The profile must belong to the authenticated organization.

Deprecated: deprecated

func (*ProfileCampaignService) List deprecated added in v0.9.0

**Deprecated.** This endpoint is replaced by `/v3/sender-profiles` and will be removed in a future release. It still behaves exactly as before, so nothing needs to change today — but new integrations should use `/v3/sender-profiles`, which models a profile's markets, compliance, brand, campaigns and billing explicitly.

Retrieves all campaigns linked to the profile's brand, including use cases and sample messages. Returns inherited campaigns if inherit_tcr_campaign=true.

Deprecated: deprecated

func (*ProfileCampaignService) New deprecated added in v0.9.0

**Deprecated.** This endpoint is replaced by `/v3/sender-profiles` and will be removed in a future release. It still behaves exactly as before, so nothing needs to change today — but new integrations should use `/v3/sender-profiles`, which models a profile's markets, compliance, brand, campaigns and billing explicitly.

Creates a new campaign scoped under the brand of the specified profile. Each campaign must include at least one use case with sample messages.

Deprecated: deprecated

func (*ProfileCampaignService) Update deprecated added in v0.9.0

**Deprecated.** This endpoint is replaced by `/v3/sender-profiles` and will be removed in a future release. It still behaves exactly as before, so nothing needs to change today — but new integrations should use `/v3/sender-profiles`, which models a profile's markets, compliance, brand, campaigns and billing explicitly.

Updates an existing campaign under the brand of the specified profile. Cannot update campaigns that have already been submitted to TCR.

Deprecated: deprecated

type ProfileCampaignUpdateParams added in v0.9.0

type ProfileCampaignUpdateParams struct {
	ProfileID string `path:"profileId" api:"required" format:"uuid" json:"-"`
	// Campaign data for create or update operation
	Campaign ProfileCampaignUpdateParamsCampaign `json:"campaign,omitzero" api:"required"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ProfileCampaignUpdateParams) MarshalJSON added in v0.9.0

func (r ProfileCampaignUpdateParams) MarshalJSON() (data []byte, err error)

func (*ProfileCampaignUpdateParams) UnmarshalJSON added in v0.9.0

func (r *ProfileCampaignUpdateParams) UnmarshalJSON(data []byte) error

type ProfileCampaignUpdateParamsCampaign added in v0.23.0

type ProfileCampaignUpdateParamsCampaign struct {
	// Campaign description
	Description string `json:"description" api:"required"`
	// Campaign name
	Name string `json:"name" api:"required"`
	// Campaign type (e.g., "KYC", "App").
	//
	// Still required of a caller, and consulted by nothing. It named the signup path
	// that produced the campaign, was written to a column no query filters on, no TCR
	// payload carries and no fee or status decision reads, and is now defaulted at the
	// entity instead. It stays required so that a request which was valid before is
	// still valid — dropping it would be the client-visible change, not keeping it.
	Type string `json:"type" api:"required"`
	// List of use cases with sample messages
	UseCases []ProfileCampaignUpdateParamsCampaignUseCase `json:"useCases,omitzero" api:"required"`
	// Comma-separated keywords that trigger help message (e.g., "HELP, INFO, SUPPORT")
	HelpKeywords param.Opt[string] `json:"helpKeywords,omitzero"`
	// Message sent when user requests help
	HelpMessage param.Opt[string] `json:"helpMessage,omitzero"`
	// Description of how messages flow in the campaign
	MessageFlow param.Opt[string] `json:"messageFlow,omitzero"`
	// Comma-separated keywords that trigger opt-in (e.g., "YES, START, SUBSCRIBE")
	OptinKeywords param.Opt[string] `json:"optinKeywords,omitzero"`
	// Message sent when user opts in
	OptinMessage param.Opt[string] `json:"optinMessage,omitzero"`
	// Comma-separated keywords that trigger opt-out (e.g., "STOP, UNSUBSCRIBE, END")
	OptoutKeywords param.Opt[string] `json:"optoutKeywords,omitzero"`
	// Message sent when user opts out
	OptoutMessage param.Opt[string] `json:"optoutMessage,omitzero"`
	// URL to privacy policy
	PrivacyPolicyLink param.Opt[string] `json:"privacyPolicyLink,omitzero" format:"uri"`
	// URL to terms and conditions
	TermsAndConditionsLink param.Opt[string] `json:"termsAndConditionsLink,omitzero" format:"uri"`
	// Expected messaging volume for this campaign. Numeric string (e.g. "1999",
	// "5000"). Values below 2000 bill at the low-volume tier.
	Volume param.Opt[string] `json:"volume,omitzero"`
	// contains filtered or unexported fields
}

Campaign data for create or update operation

The properties Description, Name, Type, UseCases are required.

func (ProfileCampaignUpdateParamsCampaign) MarshalJSON added in v0.23.0

func (r ProfileCampaignUpdateParamsCampaign) MarshalJSON() (data []byte, err error)

func (*ProfileCampaignUpdateParamsCampaign) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignUpdateParamsCampaign) UnmarshalJSON(data []byte) error

type ProfileCampaignUpdateParamsCampaignUseCase added in v0.23.0

type ProfileCampaignUpdateParamsCampaignUseCase struct {
	// Any of "MARKETING", "ACCOUNT_NOTIFICATION", "CUSTOMER_CARE", "FRAUD_ALERT",
	// "TWO_FA", "DELIVERY_NOTIFICATION", "SECURITY_ALERT", "M2M", "MIXED",
	// "HIGHER_EDUCATION", "POLLING_VOTING", "PUBLIC_SERVICE_ANNOUNCEMENT",
	// "LOW_VOLUME".
	MessagingUseCaseUs MessagingUseCaseUs `json:"messagingUseCaseUs,omitzero" api:"required"`
	// Sample messages for this use case (1-5 messages, max 1024 characters each)
	SampleMessages []string `json:"sampleMessages,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Campaign use case with sample messages

The properties MessagingUseCaseUs, SampleMessages are required.

func (ProfileCampaignUpdateParamsCampaignUseCase) MarshalJSON added in v0.23.0

func (r ProfileCampaignUpdateParamsCampaignUseCase) MarshalJSON() (data []byte, err error)

func (*ProfileCampaignUpdateParamsCampaignUseCase) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignUpdateParamsCampaignUseCase) UnmarshalJSON(data []byte) error

type ProfileCampaignUpdateResponse added in v0.23.0

type ProfileCampaignUpdateResponse struct {
	// A 10DLC campaign registered for a brand.
	Data ProfileCampaignUpdateResponseData `json:"data" api:"nullable"`
	// Error information
	Error ProfileCampaignUpdateResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ProfileCampaignUpdateResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ProfileCampaignUpdateResponse) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignUpdateResponse) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignUpdateResponse) UnmarshalJSON(data []byte) error

type ProfileCampaignUpdateResponseData added in v0.23.0

type ProfileCampaignUpdateResponseData struct {
	ID         string    `json:"id" format:"uuid"`
	BilledDate time.Time `json:"billedDate" api:"nullable" format:"date-time"`
	BrandID    string    `json:"brandId" api:"nullable" format:"uuid"`
	Cost       float64   `json:"cost" api:"nullable" format:"decimal"`
	CreatedAt  time.Time `json:"createdAt" format:"date-time"`
	CustomerID string    `json:"customerId" format:"uuid"`
	// True once every carrier has completed its DCA election and the campaign is
	// operationally ready for traffic.
	DcaElectionsComplete    bool      `json:"dcaElectionsComplete" api:"nullable"`
	DcaElectionsCompletedAt time.Time `json:"dcaElectionsCompletedAt" api:"nullable" format:"date-time"`
	Description             string    `json:"description"`
	// True when the one-time campaign submission fee has already been charged.
	HasSubmissionTransaction bool   `json:"hasSubmissionTransaction"`
	HelpKeywords             string `json:"helpKeywords" api:"nullable"`
	HelpMessage              string `json:"helpMessage" api:"nullable"`
	MessageFlow              string `json:"messageFlow" api:"nullable"`
	Name                     string `json:"name"`
	OptinKeywords            string `json:"optinKeywords" api:"nullable"`
	OptinMessage             string `json:"optinMessage" api:"nullable"`
	OptoutKeywords           string `json:"optoutKeywords" api:"nullable"`
	OptoutMessage            string `json:"optoutMessage" api:"nullable"`
	PrivacyPolicyLink        string `json:"privacyPolicyLink" api:"nullable"`
	// Any of "SENT_CREATED", "ACTIVE", "EXPIRED".
	Status         string    `json:"status" api:"nullable"`
	SubmittedAt    time.Time `json:"submittedAt" api:"nullable" format:"date-time"`
	SubmittedToTcr bool      `json:"submittedToTCR"`
	// The Campaign Registry identifier, once the campaign has been accepted.
	TcrCampaignID string `json:"tcrCampaignId" api:"nullable"`
	// Surfaced so customers can see why a submission did not reach the registry.
	TcrSyncError           string `json:"tcrSyncError" api:"nullable"`
	TermsAndConditionsLink string `json:"termsAndConditionsLink" api:"nullable"`
	// Campaign type (for example KYC or App).
	Type      string                                     `json:"type"`
	UpdatedAt time.Time                                  `json:"updatedAt" api:"nullable" format:"date-time"`
	UseCases  []ProfileCampaignUpdateResponseDataUseCase `json:"useCases"`
	// Expected messaging volume for this campaign — customer-supplied on
	// create/update, and the input to both the TCR usecase classification (LOW_VOLUME
	// vs MIXED/specific) and the campaign fee tier. Surfaced so customers can read
	// back the value they set.
	Volume string `json:"volume" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		BilledDate               respjson.Field
		BrandID                  respjson.Field
		Cost                     respjson.Field
		CreatedAt                respjson.Field
		CustomerID               respjson.Field
		DcaElectionsComplete     respjson.Field
		DcaElectionsCompletedAt  respjson.Field
		Description              respjson.Field
		HasSubmissionTransaction respjson.Field
		HelpKeywords             respjson.Field
		HelpMessage              respjson.Field
		MessageFlow              respjson.Field
		Name                     respjson.Field
		OptinKeywords            respjson.Field
		OptinMessage             respjson.Field
		OptoutKeywords           respjson.Field
		OptoutMessage            respjson.Field
		PrivacyPolicyLink        respjson.Field
		Status                   respjson.Field
		SubmittedAt              respjson.Field
		SubmittedToTcr           respjson.Field
		TcrCampaignID            respjson.Field
		TcrSyncError             respjson.Field
		TermsAndConditionsLink   respjson.Field
		Type                     respjson.Field
		UpdatedAt                respjson.Field
		UseCases                 respjson.Field
		Volume                   respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A 10DLC campaign registered for a brand.

func (ProfileCampaignUpdateResponseData) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignUpdateResponseData) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignUpdateResponseData) UnmarshalJSON(data []byte) error

type ProfileCampaignUpdateResponseDataUseCase added in v0.23.0

type ProfileCampaignUpdateResponseDataUseCase struct {
	ID         string    `json:"id" format:"uuid"`
	CampaignID string    `json:"campaignId" format:"uuid"`
	CreatedAt  time.Time `json:"createdAt" format:"date-time"`
	CustomerID string    `json:"customerId" format:"uuid"`
	// Any of "MARKETING", "ACCOUNT_NOTIFICATION", "CUSTOMER_CARE", "FRAUD_ALERT",
	// "TWO_FA", "DELIVERY_NOTIFICATION", "SECURITY_ALERT", "M2M", "MIXED",
	// "HIGHER_EDUCATION", "POLLING_VOTING", "PUBLIC_SERVICE_ANNOUNCEMENT",
	// "LOW_VOLUME".
	MessagingUseCaseUs MessagingUseCaseUs `json:"messagingUseCaseUs"`
	// Sample messages submitted to the registry for this use case.
	SampleMessages []string  `json:"sampleMessages"`
	UpdatedAt      time.Time `json:"updatedAt" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		CampaignID         respjson.Field
		CreatedAt          respjson.Field
		CustomerID         respjson.Field
		MessagingUseCaseUs respjson.Field
		SampleMessages     respjson.Field
		UpdatedAt          respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Customer-facing use-case representation for the public v3 campaign contract. Exists for the same reason as BrandCampaignV3Response: nesting the TcrCampaignUseCase database entity in a public response means any column added to that table silently becomes part of the customer-facing contract. This DTO is an explicit allowlist, so a new column stays invisible until it is added here on purpose. This mirrors exactly the fields the entity already serialized, so it removes nothing from the current response shape. It only closes the future-leak path.

func (ProfileCampaignUpdateResponseDataUseCase) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignUpdateResponseDataUseCase) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignUpdateResponseDataUseCase) UnmarshalJSON(data []byte) error

type ProfileCampaignUpdateResponseError added in v0.23.0

type ProfileCampaignUpdateResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ProfileCampaignUpdateResponseError) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignUpdateResponseError) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignUpdateResponseError) UnmarshalJSON(data []byte) error

type ProfileCampaignUpdateResponseMeta added in v0.23.0

type ProfileCampaignUpdateResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ProfileCampaignUpdateResponseMeta) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCampaignUpdateResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ProfileCampaignUpdateResponseMeta) UnmarshalJSON(data []byte) error

type ProfileCompleteParams added in v0.7.0

type ProfileCompleteParams struct {
	// Webhook URL to call when profile completion finishes (success or failure)
	WebHookURL string `json:"webHookUrl" api:"required" format:"uri"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ProfileCompleteParams) MarshalJSON added in v0.7.0

func (r ProfileCompleteParams) MarshalJSON() (data []byte, err error)

func (*ProfileCompleteParams) UnmarshalJSON added in v0.7.0

func (r *ProfileCompleteParams) UnmarshalJSON(data []byte) error

type ProfileCompleteResponse added in v0.7.0

type ProfileCompleteResponse struct {
	// Response when a profile is already in the completed state and no further action
	// is taken.
	Data ProfileCompleteResponseData `json:"data" api:"nullable"`
	// Error information
	Error ProfileCompleteResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ProfileCompleteResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ProfileCompleteResponse) RawJSON added in v0.22.0

func (r ProfileCompleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileCompleteResponse) UnmarshalJSON added in v0.22.0

func (r *ProfileCompleteResponse) UnmarshalJSON(data []byte) error

type ProfileCompleteResponseData added in v0.22.0

type ProfileCompleteResponseData struct {
	// Human-readable message describing the result.
	Message string `json:"message"`
	// Current process status of the profile (e.g., "completed", "submitted",
	// "in_progress").
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response when a profile is already in the completed state and no further action is taken.

func (ProfileCompleteResponseData) RawJSON added in v0.22.0

func (r ProfileCompleteResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileCompleteResponseData) UnmarshalJSON added in v0.22.0

func (r *ProfileCompleteResponseData) UnmarshalJSON(data []byte) error

type ProfileCompleteResponseError added in v0.23.0

type ProfileCompleteResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ProfileCompleteResponseError) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileCompleteResponseError) UnmarshalJSON added in v0.23.0

func (r *ProfileCompleteResponseError) UnmarshalJSON(data []byte) error

type ProfileCompleteResponseMeta added in v0.23.0

type ProfileCompleteResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ProfileCompleteResponseMeta) RawJSON added in v0.23.0

func (r ProfileCompleteResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileCompleteResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ProfileCompleteResponseMeta) UnmarshalJSON(data []byte) error

type ProfileDeleteParams added in v0.7.0

type ProfileDeleteParams struct {
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox    param.Opt[bool]   `json:"sandbox,omitzero"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ProfileDeleteParams) MarshalJSON added in v0.7.0

func (r ProfileDeleteParams) MarshalJSON() (data []byte, err error)

func (*ProfileDeleteParams) UnmarshalJSON added in v0.7.0

func (r *ProfileDeleteParams) UnmarshalJSON(data []byte) error

type ProfileGetParams added in v0.8.0

type ProfileGetParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type ProfileGetResponse added in v0.23.0

type ProfileGetResponse struct {
	// Detailed profile response for v3 API
	Data ProfileGetResponseData `json:"data" api:"nullable"`
	// Error information
	Error ProfileGetResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ProfileGetResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ProfileGetResponse) RawJSON added in v0.23.0

func (r ProfileGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileGetResponse) UnmarshalJSON added in v0.23.0

func (r *ProfileGetResponse) UnmarshalJSON(data []byte) error

type ProfileGetResponseData added in v0.23.0

type ProfileGetResponseData struct {
	// Profile unique identifier
	ID string `json:"id" format:"uuid"`
	// Always false. A profile no longer shares contacts with sibling profiles — it
	// sees only what it owns. Retained so existing v3 clients reading
	// allow_contact_sharing keep deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowContactSharing bool `json:"allow_contact_sharing" api:"nullable"`
	// Whether number changes are allowed during onboarding
	AllowNumberChangeDuringOnboarding bool `json:"allow_number_change_during_onboarding" api:"nullable"`
	// Always false. A profile no longer shares templates with sibling profiles.
	// Retained so existing v3 clients reading allow_template_sharing keep
	// deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowTemplateSharing bool `json:"allow_template_sharing" api:"nullable"`
	// Billing contact info returned in profile responses
	BillingContact ProfileGetResponseDataBillingContact `json:"billing_contact" api:"nullable"`
	// Billing model: profile, organization, or profile_and_organization
	BillingModel string `json:"billing_model"`
	// Brand response with nested contact, business, and compliance sections — mirrors
	// the request structure.
	Brand ProfileGetResponseDataBrand `json:"brand" api:"nullable"`
	// When the profile was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Profile description
	Description string `json:"description" api:"nullable"`
	// Profile email (inherited from organization)
	Email string `json:"email" api:"nullable"`
	// Profile icon URL
	Icon string `json:"icon" api:"nullable"`
	// Always false. A profile no longer inherits its organization's contacts. Retained
	// so existing v3 clients reading inherit_contacts keep deserializing; it carries
	// no information.
	//
	// Deprecated: deprecated
	InheritContacts bool `json:"inherit_contacts" api:"nullable"`
	// Whether this profile inherits TCR brand from the organization
	InheritTcrBrand bool `json:"inherit_tcr_brand"`
	// Whether this profile inherits TCR campaign from the organization
	InheritTcrCampaign bool `json:"inherit_tcr_campaign"`
	// Always false. A profile no longer inherits its organization's templates.
	// Retained so existing v3 clients reading inherit_templates keep deserializing; it
	// carries no information.
	//
	// Deprecated: deprecated
	InheritTemplates bool `json:"inherit_templates" api:"nullable"`
	// Profile name
	Name string `json:"name"`
	// Parent organization ID
	OrganizationID string `json:"organization_id" api:"nullable" format:"uuid"`
	// Direct SMS phone number
	SendingPhoneNumber string `json:"sending_phone_number" api:"nullable"`
	// Deprecated. Always null. Sender borrowing is gone: a profile no longer points at
	// another profile for its SMS sender, and every profile owns the sender it sends
	// from.
	//
	// Kept on the wire, and never populated, because those are two different promises.
	// Removing the key changes the response's shape — a generated client loses the
	// property and stops compiling on the next regenerate, for a value that is now
	// null for every profile in existence. Keeping it null costs a key and breaks
	// nobody, and null is the honest answer rather than a placeholder: there is no
	// borrowing left to report.
	//
	// Nothing could populate it. Migration 260813161500 dropped the column and copied
	// each borrower its own channel-provider row; its Down() says outright that the
	// borrower-to-lender pairing is not recoverable. The only surviving trace is a
	// notes string on the copied row.
	//
	// Deprecated: deprecated
	SendingPhoneNumberProfileID string `json:"sending_phone_number_profile_id" api:"nullable" format:"uuid"`
	// Deprecated: deprecated
	SendingWhatsappNumberProfileID string `json:"sending_whatsapp_number_profile_id" api:"nullable" format:"uuid"`
	// Profile short name/abbreviation. 3–11 characters: letters, numbers, and spaces
	// only, with at least one letter.
	ShortName string `json:"short_name" api:"nullable"`
	// Profile setup status: incomplete, pending_review, approved, rejected
	Status string `json:"status"`
	// When the profile was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// WhatsApp Business Account ID associated with this profile. Present whether the
	// WABA is inherited from the organization or configured directly.
	WabaID string `json:"waba_id" api:"nullable"`
	// Direct WhatsApp phone number
	WhatsappPhoneNumber string `json:"whatsapp_phone_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                                respjson.Field
		AllowContactSharing               respjson.Field
		AllowNumberChangeDuringOnboarding respjson.Field
		AllowTemplateSharing              respjson.Field
		BillingContact                    respjson.Field
		BillingModel                      respjson.Field
		Brand                             respjson.Field
		CreatedAt                         respjson.Field
		Description                       respjson.Field
		Email                             respjson.Field
		Icon                              respjson.Field
		InheritContacts                   respjson.Field
		InheritTcrBrand                   respjson.Field
		InheritTcrCampaign                respjson.Field
		InheritTemplates                  respjson.Field
		Name                              respjson.Field
		OrganizationID                    respjson.Field
		SendingPhoneNumber                respjson.Field
		SendingPhoneNumberProfileID       respjson.Field
		SendingWhatsappNumberProfileID    respjson.Field
		ShortName                         respjson.Field
		Status                            respjson.Field
		UpdatedAt                         respjson.Field
		WabaID                            respjson.Field
		WhatsappPhoneNumber               respjson.Field
		ExtraFields                       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detailed profile response for v3 API

func (ProfileGetResponseData) RawJSON added in v0.23.0

func (r ProfileGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileGetResponseData) UnmarshalJSON added in v0.23.0

func (r *ProfileGetResponseData) UnmarshalJSON(data []byte) error

type ProfileGetResponseDataBillingContact added in v0.23.0

type ProfileGetResponseDataBillingContact struct {
	Address string `json:"address" api:"nullable"`
	Email   string `json:"email" api:"nullable"`
	Name    string `json:"name" api:"nullable"`
	Phone   string `json:"phone" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address     respjson.Field
		Email       respjson.Field
		Name        respjson.Field
		Phone       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Billing contact info returned in profile responses

func (ProfileGetResponseDataBillingContact) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileGetResponseDataBillingContact) UnmarshalJSON added in v0.23.0

func (r *ProfileGetResponseDataBillingContact) UnmarshalJSON(data []byte) error

type ProfileGetResponseDataBrand added in v0.23.0

type ProfileGetResponseDataBrand struct {
	// Unique identifier for the brand
	ID string `json:"id" format:"uuid"`
	// Business details and address information
	Business ProfileGetResponseDataBrandBusiness `json:"business" api:"nullable"`
	// Compliance and TCR-related information
	Compliance ProfileGetResponseDataBrandCompliance `json:"compliance" api:"nullable"`
	// Contact information for the brand
	Contact ProfileGetResponseDataBrandContact `json:"contact" api:"nullable"`
	// When the brand was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Deprecated and scheduled for removal. Identifies the Campaign Service Provider
	// that registered the brand, which is Sent, so the value is the same for every
	// brand and every account. Nothing on your side can act on it and there is no
	// replacement. Stop reading it.
	//
	// Deprecated: deprecated
	CspID string `json:"csp_id" api:"nullable"`
	// Any of "SELF_DECLARED", "UNVERIFIED", "VERIFIED", "VETTED_VERIFIED".
	IdentityStatus string `json:"identity_status" api:"nullable"`
	// Whether this brand is inherited from the parent organization
	IsInherited bool `json:"is_inherited"`
	// Any of "ACTIVE", "INACTIVE", "SUSPENDED".
	Status string `json:"status" api:"nullable"`
	// When the brand was submitted to TCR
	SubmittedAt time.Time `json:"submitted_at" api:"nullable" format:"date-time"`
	// Whether this brand has been submitted to TCR
	SubmittedToTcr bool `json:"submitted_to_tcr"`
	// TCR brand ID (populated after TCR submission)
	TcrBrandID string `json:"tcr_brand_id" api:"nullable"`
	// Universal EIN from TCR
	UniversalEin string `json:"universal_ein" api:"nullable"`
	// When the brand was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Business       respjson.Field
		Compliance     respjson.Field
		Contact        respjson.Field
		CreatedAt      respjson.Field
		CspID          respjson.Field
		IdentityStatus respjson.Field
		IsInherited    respjson.Field
		Status         respjson.Field
		SubmittedAt    respjson.Field
		SubmittedToTcr respjson.Field
		TcrBrandID     respjson.Field
		UniversalEin   respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Brand response with nested contact, business, and compliance sections — mirrors the request structure.

func (ProfileGetResponseDataBrand) RawJSON added in v0.23.0

func (r ProfileGetResponseDataBrand) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileGetResponseDataBrand) UnmarshalJSON added in v0.23.0

func (r *ProfileGetResponseDataBrand) UnmarshalJSON(data []byte) error

type ProfileGetResponseDataBrandBusiness added in v0.23.0

type ProfileGetResponseDataBrandBusiness struct {
	// City
	City string `json:"city" api:"nullable"`
	// Country code (e.g., US, CA)
	Country string `json:"country" api:"nullable"`
	// Country where the business is registered
	CountryOfRegistration string `json:"country_of_registration" api:"nullable"`
	// Business entity type
	EntityType string `json:"entity_type" api:"nullable"`
	// Legal business name
	LegalName string `json:"legal_name" api:"nullable"`
	// Postal/ZIP code
	PostalCode string `json:"postal_code" api:"nullable"`
	// State/province code
	State string `json:"state" api:"nullable"`
	// Street address
	Street string `json:"street" api:"nullable"`
	// Tax ID/EIN number
	TaxID string `json:"tax_id" api:"nullable"`
	// Type of tax ID (e.g., us_ein, ca_bn)
	TaxIDType string `json:"tax_id_type" api:"nullable"`
	// Business website URL
	URL string `json:"url" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City                  respjson.Field
		Country               respjson.Field
		CountryOfRegistration respjson.Field
		EntityType            respjson.Field
		LegalName             respjson.Field
		PostalCode            respjson.Field
		State                 respjson.Field
		Street                respjson.Field
		TaxID                 respjson.Field
		TaxIDType             respjson.Field
		URL                   respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Business details and address information

func (ProfileGetResponseDataBrandBusiness) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileGetResponseDataBrandBusiness) UnmarshalJSON added in v0.23.0

func (r *ProfileGetResponseDataBrandBusiness) UnmarshalJSON(data []byte) error

type ProfileGetResponseDataBrandCompliance added in v0.23.0

type ProfileGetResponseDataBrandCompliance struct {
	// Any of "BASIC_ACCOUNT", "MEDIUM_ACCOUNT", "LARGE_ACCOUNT", "SMALL_ACCOUNT",
	// "KEY_ACCOUNT".
	BrandRelationship TcrBrandRelationship `json:"brand_relationship" api:"nullable"`
	// List of destination countries for messaging
	DestinationCountries []DestinationCountry `json:"destination_countries"`
	// Whether this is a TCR (Campaign Registry) application
	IsTcrApplication bool `json:"is_tcr_application"`
	// Additional notes about the business or use case
	Notes string `json:"notes" api:"nullable"`
	// Phone number prefix for messaging (e.g., "+1")
	PhoneNumberPrefix string `json:"phone_number_prefix" api:"nullable"`
	// Always null. The brand's free-text primary use case is no longer stored: it
	// reached neither TCR nor any decision, and its column is dropped with no
	// backfill, because the values were prose and the typed equivalent is the
	// campaign's MessagingUseCaseUS.
	//
	// Retained so existing v3 clients reading primary_use_case keep deserializing.
	// Unlike the profile sharing flags, which can answer false truthfully, there is no
	// value to report here — the field is present and empty rather than present and
	// wrong.
	//
	// Deprecated: deprecated
	PrimaryUseCase string `json:"primary_use_case" api:"nullable"`
	// Any of "PROFESSIONAL", "REAL_ESTATE", "HEALTHCARE", "HUMAN_RESOURCES", "ENERGY",
	// "ENTERTAINMENT", "RETAIL", "TRANSPORTATION", "AGRICULTURE", "INSURANCE",
	// "POSTAL", "EDUCATION", "HOSPITALITY", "FINANCIAL", "POLITICAL", "GAMBLING",
	// "LEGAL", "CONSTRUCTION", "NGO", "MANUFACTURING", "GOVERNMENT", "TECHNOLOGY",
	// "COMMUNICATION".
	Vertical TcrVertical `json:"vertical" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BrandRelationship    respjson.Field
		DestinationCountries respjson.Field
		IsTcrApplication     respjson.Field
		Notes                respjson.Field
		PhoneNumberPrefix    respjson.Field
		PrimaryUseCase       respjson.Field
		Vertical             respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compliance and TCR-related information

func (ProfileGetResponseDataBrandCompliance) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileGetResponseDataBrandCompliance) UnmarshalJSON added in v0.23.0

func (r *ProfileGetResponseDataBrandCompliance) UnmarshalJSON(data []byte) error

type ProfileGetResponseDataBrandContact added in v0.23.0

type ProfileGetResponseDataBrandContact struct {
	// Business/brand name
	BusinessName string `json:"business_name" api:"nullable"`
	// Contact email address
	Email string `json:"email" api:"nullable"`
	// Primary contact name
	Name string `json:"name"`
	// Contact phone number in E.164 format
	Phone string `json:"phone" api:"nullable"`
	// Contact phone country code (e.g., "1" for US)
	PhoneCountryCode string `json:"phone_country_code" api:"nullable"`
	// Contact's role in the business
	Role string `json:"role" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BusinessName     respjson.Field
		Email            respjson.Field
		Name             respjson.Field
		Phone            respjson.Field
		PhoneCountryCode respjson.Field
		Role             respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Contact information for the brand

func (ProfileGetResponseDataBrandContact) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileGetResponseDataBrandContact) UnmarshalJSON added in v0.23.0

func (r *ProfileGetResponseDataBrandContact) UnmarshalJSON(data []byte) error

type ProfileGetResponseError added in v0.23.0

type ProfileGetResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ProfileGetResponseError) RawJSON added in v0.23.0

func (r ProfileGetResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileGetResponseError) UnmarshalJSON added in v0.23.0

func (r *ProfileGetResponseError) UnmarshalJSON(data []byte) error

type ProfileGetResponseMeta added in v0.23.0

type ProfileGetResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ProfileGetResponseMeta) RawJSON added in v0.23.0

func (r ProfileGetResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileGetResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ProfileGetResponseMeta) UnmarshalJSON(data []byte) error

type ProfileListParams added in v0.8.0

type ProfileListParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type ProfileListResponse added in v0.7.0

type ProfileListResponse struct {
	// The profiles in the organization.
	Data ProfileListResponseData `json:"data" api:"nullable"`
	// Error information
	Error ProfileListResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ProfileListResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ProfileListResponse) RawJSON added in v0.7.0

func (r ProfileListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileListResponse) UnmarshalJSON added in v0.7.0

func (r *ProfileListResponse) UnmarshalJSON(data []byte) error

type ProfileListResponseData added in v0.7.0

type ProfileListResponseData struct {
	// Pagination metadata for list responses
	Pagination ProfileListResponseDataPagination `json:"pagination"`
	// The profiles on this page.
	Profiles []ProfileListResponseDataProfile `json:"profiles"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Pagination  respjson.Field
		Profiles    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The profiles in the organization.

func (ProfileListResponseData) RawJSON added in v0.7.0

func (r ProfileListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileListResponseData) UnmarshalJSON added in v0.7.0

func (r *ProfileListResponseData) UnmarshalJSON(data []byte) error

type ProfileListResponseDataPagination added in v0.32.0

type ProfileListResponseDataPagination struct {
	// Cursor-based pagination. Never populated — see Cursors.
	//
	// Deprecated: deprecated
	Cursors ProfileListResponseDataPaginationCursors `json:"cursors" api:"nullable"`
	// Whether there are more pages after this one
	HasMore bool `json:"has_more"`
	// Current page number (1-indexed)
	Page int64 `json:"page"`
	// Number of items per page
	PageSize int64 `json:"page_size"`
	// Total number of items across all pages
	TotalCount int64 `json:"total_count"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cursors     respjson.Field
		HasMore     respjson.Field
		Page        respjson.Field
		PageSize    respjson.Field
		TotalCount  respjson.Field
		TotalPages  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata for list responses

func (ProfileListResponseDataPagination) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ProfileListResponseDataPagination) UnmarshalJSON added in v0.32.0

func (r *ProfileListResponseDataPagination) UnmarshalJSON(data []byte) error

type ProfileListResponseDataPaginationCursors deprecated added in v0.32.0

type ProfileListResponseDataPaginationCursors struct {
	// Cursor to fetch the next page.
	After string `json:"after" api:"nullable"`
	// Cursor to fetch the previous page.
	Before string `json:"before" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cursor-based pagination. Never populated — see Cursors.

Deprecated: deprecated

func (ProfileListResponseDataPaginationCursors) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*ProfileListResponseDataPaginationCursors) UnmarshalJSON added in v0.32.0

func (r *ProfileListResponseDataPaginationCursors) UnmarshalJSON(data []byte) error

type ProfileListResponseDataProfile added in v0.23.0

type ProfileListResponseDataProfile struct {
	// Profile unique identifier
	ID string `json:"id" format:"uuid"`
	// Always false. A profile no longer shares contacts with sibling profiles — it
	// sees only what it owns. Retained so existing v3 clients reading
	// allow_contact_sharing keep deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowContactSharing bool `json:"allow_contact_sharing" api:"nullable"`
	// Whether number changes are allowed during onboarding
	AllowNumberChangeDuringOnboarding bool `json:"allow_number_change_during_onboarding" api:"nullable"`
	// Always false. A profile no longer shares templates with sibling profiles.
	// Retained so existing v3 clients reading allow_template_sharing keep
	// deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowTemplateSharing bool `json:"allow_template_sharing" api:"nullable"`
	// Billing contact info returned in profile responses
	BillingContact ProfileListResponseDataProfileBillingContact `json:"billing_contact" api:"nullable"`
	// Billing model: profile, organization, or profile_and_organization
	BillingModel string `json:"billing_model"`
	// Brand response with nested contact, business, and compliance sections — mirrors
	// the request structure.
	Brand ProfileListResponseDataProfileBrand `json:"brand" api:"nullable"`
	// When the profile was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Profile description
	Description string `json:"description" api:"nullable"`
	// Profile email (inherited from organization)
	Email string `json:"email" api:"nullable"`
	// Profile icon URL
	Icon string `json:"icon" api:"nullable"`
	// Always false. A profile no longer inherits its organization's contacts. Retained
	// so existing v3 clients reading inherit_contacts keep deserializing; it carries
	// no information.
	//
	// Deprecated: deprecated
	InheritContacts bool `json:"inherit_contacts" api:"nullable"`
	// Whether this profile inherits TCR brand from the organization
	InheritTcrBrand bool `json:"inherit_tcr_brand"`
	// Whether this profile inherits TCR campaign from the organization
	InheritTcrCampaign bool `json:"inherit_tcr_campaign"`
	// Always false. A profile no longer inherits its organization's templates.
	// Retained so existing v3 clients reading inherit_templates keep deserializing; it
	// carries no information.
	//
	// Deprecated: deprecated
	InheritTemplates bool `json:"inherit_templates" api:"nullable"`
	// Profile name
	Name string `json:"name"`
	// Parent organization ID
	OrganizationID string `json:"organization_id" api:"nullable" format:"uuid"`
	// Direct SMS phone number
	SendingPhoneNumber string `json:"sending_phone_number" api:"nullable"`
	// Deprecated. Always null. Sender borrowing is gone: a profile no longer points at
	// another profile for its SMS sender, and every profile owns the sender it sends
	// from.
	//
	// Kept on the wire, and never populated, because those are two different promises.
	// Removing the key changes the response's shape — a generated client loses the
	// property and stops compiling on the next regenerate, for a value that is now
	// null for every profile in existence. Keeping it null costs a key and breaks
	// nobody, and null is the honest answer rather than a placeholder: there is no
	// borrowing left to report.
	//
	// Nothing could populate it. Migration 260813161500 dropped the column and copied
	// each borrower its own channel-provider row; its Down() says outright that the
	// borrower-to-lender pairing is not recoverable. The only surviving trace is a
	// notes string on the copied row.
	//
	// Deprecated: deprecated
	SendingPhoneNumberProfileID string `json:"sending_phone_number_profile_id" api:"nullable" format:"uuid"`
	// Deprecated: deprecated
	SendingWhatsappNumberProfileID string `json:"sending_whatsapp_number_profile_id" api:"nullable" format:"uuid"`
	// Profile short name/abbreviation. 3–11 characters: letters, numbers, and spaces
	// only, with at least one letter.
	ShortName string `json:"short_name" api:"nullable"`
	// Profile setup status: incomplete, pending_review, approved, rejected
	Status string `json:"status"`
	// When the profile was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// WhatsApp Business Account ID associated with this profile. Present whether the
	// WABA is inherited from the organization or configured directly.
	WabaID string `json:"waba_id" api:"nullable"`
	// Direct WhatsApp phone number
	WhatsappPhoneNumber string `json:"whatsapp_phone_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                                respjson.Field
		AllowContactSharing               respjson.Field
		AllowNumberChangeDuringOnboarding respjson.Field
		AllowTemplateSharing              respjson.Field
		BillingContact                    respjson.Field
		BillingModel                      respjson.Field
		Brand                             respjson.Field
		CreatedAt                         respjson.Field
		Description                       respjson.Field
		Email                             respjson.Field
		Icon                              respjson.Field
		InheritContacts                   respjson.Field
		InheritTcrBrand                   respjson.Field
		InheritTcrCampaign                respjson.Field
		InheritTemplates                  respjson.Field
		Name                              respjson.Field
		OrganizationID                    respjson.Field
		SendingPhoneNumber                respjson.Field
		SendingPhoneNumberProfileID       respjson.Field
		SendingWhatsappNumberProfileID    respjson.Field
		ShortName                         respjson.Field
		Status                            respjson.Field
		UpdatedAt                         respjson.Field
		WabaID                            respjson.Field
		WhatsappPhoneNumber               respjson.Field
		ExtraFields                       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detailed profile response for v3 API

func (ProfileListResponseDataProfile) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileListResponseDataProfile) UnmarshalJSON added in v0.23.0

func (r *ProfileListResponseDataProfile) UnmarshalJSON(data []byte) error

type ProfileListResponseDataProfileBillingContact added in v0.23.0

type ProfileListResponseDataProfileBillingContact struct {
	Address string `json:"address" api:"nullable"`
	Email   string `json:"email" api:"nullable"`
	Name    string `json:"name" api:"nullable"`
	Phone   string `json:"phone" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address     respjson.Field
		Email       respjson.Field
		Name        respjson.Field
		Phone       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Billing contact info returned in profile responses

func (ProfileListResponseDataProfileBillingContact) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileListResponseDataProfileBillingContact) UnmarshalJSON added in v0.23.0

func (r *ProfileListResponseDataProfileBillingContact) UnmarshalJSON(data []byte) error

type ProfileListResponseDataProfileBrand added in v0.23.0

type ProfileListResponseDataProfileBrand struct {
	// Unique identifier for the brand
	ID string `json:"id" format:"uuid"`
	// Business details and address information
	Business ProfileListResponseDataProfileBrandBusiness `json:"business" api:"nullable"`
	// Compliance and TCR-related information
	Compliance ProfileListResponseDataProfileBrandCompliance `json:"compliance" api:"nullable"`
	// Contact information for the brand
	Contact ProfileListResponseDataProfileBrandContact `json:"contact" api:"nullable"`
	// When the brand was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Deprecated and scheduled for removal. Identifies the Campaign Service Provider
	// that registered the brand, which is Sent, so the value is the same for every
	// brand and every account. Nothing on your side can act on it and there is no
	// replacement. Stop reading it.
	//
	// Deprecated: deprecated
	CspID string `json:"csp_id" api:"nullable"`
	// Any of "SELF_DECLARED", "UNVERIFIED", "VERIFIED", "VETTED_VERIFIED".
	IdentityStatus string `json:"identity_status" api:"nullable"`
	// Whether this brand is inherited from the parent organization
	IsInherited bool `json:"is_inherited"`
	// Any of "ACTIVE", "INACTIVE", "SUSPENDED".
	Status string `json:"status" api:"nullable"`
	// When the brand was submitted to TCR
	SubmittedAt time.Time `json:"submitted_at" api:"nullable" format:"date-time"`
	// Whether this brand has been submitted to TCR
	SubmittedToTcr bool `json:"submitted_to_tcr"`
	// TCR brand ID (populated after TCR submission)
	TcrBrandID string `json:"tcr_brand_id" api:"nullable"`
	// Universal EIN from TCR
	UniversalEin string `json:"universal_ein" api:"nullable"`
	// When the brand was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Business       respjson.Field
		Compliance     respjson.Field
		Contact        respjson.Field
		CreatedAt      respjson.Field
		CspID          respjson.Field
		IdentityStatus respjson.Field
		IsInherited    respjson.Field
		Status         respjson.Field
		SubmittedAt    respjson.Field
		SubmittedToTcr respjson.Field
		TcrBrandID     respjson.Field
		UniversalEin   respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Brand response with nested contact, business, and compliance sections — mirrors the request structure.

func (ProfileListResponseDataProfileBrand) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileListResponseDataProfileBrand) UnmarshalJSON added in v0.23.0

func (r *ProfileListResponseDataProfileBrand) UnmarshalJSON(data []byte) error

type ProfileListResponseDataProfileBrandBusiness added in v0.23.0

type ProfileListResponseDataProfileBrandBusiness struct {
	// City
	City string `json:"city" api:"nullable"`
	// Country code (e.g., US, CA)
	Country string `json:"country" api:"nullable"`
	// Country where the business is registered
	CountryOfRegistration string `json:"country_of_registration" api:"nullable"`
	// Business entity type
	EntityType string `json:"entity_type" api:"nullable"`
	// Legal business name
	LegalName string `json:"legal_name" api:"nullable"`
	// Postal/ZIP code
	PostalCode string `json:"postal_code" api:"nullable"`
	// State/province code
	State string `json:"state" api:"nullable"`
	// Street address
	Street string `json:"street" api:"nullable"`
	// Tax ID/EIN number
	TaxID string `json:"tax_id" api:"nullable"`
	// Type of tax ID (e.g., us_ein, ca_bn)
	TaxIDType string `json:"tax_id_type" api:"nullable"`
	// Business website URL
	URL string `json:"url" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City                  respjson.Field
		Country               respjson.Field
		CountryOfRegistration respjson.Field
		EntityType            respjson.Field
		LegalName             respjson.Field
		PostalCode            respjson.Field
		State                 respjson.Field
		Street                respjson.Field
		TaxID                 respjson.Field
		TaxIDType             respjson.Field
		URL                   respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Business details and address information

func (ProfileListResponseDataProfileBrandBusiness) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileListResponseDataProfileBrandBusiness) UnmarshalJSON added in v0.23.0

func (r *ProfileListResponseDataProfileBrandBusiness) UnmarshalJSON(data []byte) error

type ProfileListResponseDataProfileBrandCompliance added in v0.23.0

type ProfileListResponseDataProfileBrandCompliance struct {
	// Any of "BASIC_ACCOUNT", "MEDIUM_ACCOUNT", "LARGE_ACCOUNT", "SMALL_ACCOUNT",
	// "KEY_ACCOUNT".
	BrandRelationship TcrBrandRelationship `json:"brand_relationship" api:"nullable"`
	// List of destination countries for messaging
	DestinationCountries []DestinationCountry `json:"destination_countries"`
	// Whether this is a TCR (Campaign Registry) application
	IsTcrApplication bool `json:"is_tcr_application"`
	// Additional notes about the business or use case
	Notes string `json:"notes" api:"nullable"`
	// Phone number prefix for messaging (e.g., "+1")
	PhoneNumberPrefix string `json:"phone_number_prefix" api:"nullable"`
	// Always null. The brand's free-text primary use case is no longer stored: it
	// reached neither TCR nor any decision, and its column is dropped with no
	// backfill, because the values were prose and the typed equivalent is the
	// campaign's MessagingUseCaseUS.
	//
	// Retained so existing v3 clients reading primary_use_case keep deserializing.
	// Unlike the profile sharing flags, which can answer false truthfully, there is no
	// value to report here — the field is present and empty rather than present and
	// wrong.
	//
	// Deprecated: deprecated
	PrimaryUseCase string `json:"primary_use_case" api:"nullable"`
	// Any of "PROFESSIONAL", "REAL_ESTATE", "HEALTHCARE", "HUMAN_RESOURCES", "ENERGY",
	// "ENTERTAINMENT", "RETAIL", "TRANSPORTATION", "AGRICULTURE", "INSURANCE",
	// "POSTAL", "EDUCATION", "HOSPITALITY", "FINANCIAL", "POLITICAL", "GAMBLING",
	// "LEGAL", "CONSTRUCTION", "NGO", "MANUFACTURING", "GOVERNMENT", "TECHNOLOGY",
	// "COMMUNICATION".
	Vertical TcrVertical `json:"vertical" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BrandRelationship    respjson.Field
		DestinationCountries respjson.Field
		IsTcrApplication     respjson.Field
		Notes                respjson.Field
		PhoneNumberPrefix    respjson.Field
		PrimaryUseCase       respjson.Field
		Vertical             respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compliance and TCR-related information

func (ProfileListResponseDataProfileBrandCompliance) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileListResponseDataProfileBrandCompliance) UnmarshalJSON added in v0.23.0

func (r *ProfileListResponseDataProfileBrandCompliance) UnmarshalJSON(data []byte) error

type ProfileListResponseDataProfileBrandContact added in v0.23.0

type ProfileListResponseDataProfileBrandContact struct {
	// Business/brand name
	BusinessName string `json:"business_name" api:"nullable"`
	// Contact email address
	Email string `json:"email" api:"nullable"`
	// Primary contact name
	Name string `json:"name"`
	// Contact phone number in E.164 format
	Phone string `json:"phone" api:"nullable"`
	// Contact phone country code (e.g., "1" for US)
	PhoneCountryCode string `json:"phone_country_code" api:"nullable"`
	// Contact's role in the business
	Role string `json:"role" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BusinessName     respjson.Field
		Email            respjson.Field
		Name             respjson.Field
		Phone            respjson.Field
		PhoneCountryCode respjson.Field
		Role             respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Contact information for the brand

func (ProfileListResponseDataProfileBrandContact) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileListResponseDataProfileBrandContact) UnmarshalJSON added in v0.23.0

func (r *ProfileListResponseDataProfileBrandContact) UnmarshalJSON(data []byte) error

type ProfileListResponseError added in v0.23.0

type ProfileListResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ProfileListResponseError) RawJSON added in v0.23.0

func (r ProfileListResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileListResponseError) UnmarshalJSON added in v0.23.0

func (r *ProfileListResponseError) UnmarshalJSON(data []byte) error

type ProfileListResponseMeta added in v0.23.0

type ProfileListResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ProfileListResponseMeta) RawJSON added in v0.23.0

func (r ProfileListResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileListResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ProfileListResponseMeta) UnmarshalJSON(data []byte) error

type ProfileNewParams added in v0.7.0

type ProfileNewParams struct {
	// Deprecated. Accepted and ignored. Contact and template sharing between sender
	// profiles is gone — a profile sees only what it owns, and the organization still
	// sees all of its profiles' contacts and templates through read-time widening. The
	// four columns behind these flags were dropped by M260720120000.
	//
	// Bound rather than dropped so the properties survive on the wire and in a
	// generated client: an SDK that assigns them keeps compiling, which is the
	// compatibility this exists for. Deliberately not refused either — a 400 would
	// break an integration that is otherwise working, and the capability they ask for
	// is gone either way. Same rule as SendingPhoneNumberProfileId.
	//
	// The read is what makes this survivable: every profile reports all four as false,
	// so a caller that checks its own write can see it did not take. Requests carrying
	// one are logged, so we can tell when nobody sends them any more and the fields
	// can go for real.
	AllowContactSharing  param.Opt[bool] `json:"allow_contact_sharing,omitzero"`
	AllowTemplateSharing param.Opt[bool] `json:"allow_template_sharing,omitzero"`
	// Billing model: profile, organization, or profile_and_organization (default:
	// profile).
	//
	//   - "organization": the organization's billing details are used; no profile-level
	//     billing info needed.
	//   - "profile": the profile is billed independently; billing_contact is required.
	//   - "profile_and_organization": the profile is billed first with the organization
	//     as fallback; billing_contact is required.
	BillingModel param.Opt[string] `json:"billing_model,omitzero"`
	// Profile description (optional)
	Description param.Opt[string] `json:"description,omitzero"`
	// Profile icon URL (optional)
	Icon            param.Opt[string] `json:"icon,omitzero"`
	InheritContacts param.Opt[bool]   `json:"inherit_contacts,omitzero"`
	// Whether this profile inherits TCR brand from organization (default: false)
	InheritTcrBrand param.Opt[bool] `json:"inherit_tcr_brand,omitzero"`
	// Whether this profile inherits TCR campaign from organization (default: false)
	InheritTcrCampaign param.Opt[bool] `json:"inherit_tcr_campaign,omitzero"`
	InheritTemplates   param.Opt[bool] `json:"inherit_templates,omitzero"`
	// Profile short name/abbreviation (optional). Must be 3–11 characters, contain
	// only letters, numbers, and spaces, and include at least one letter. Example:
	// "SALES", "Mkt 2", "Support1".
	ShortName param.Opt[string] `json:"short_name,omitzero"`
	// Profile name (required)
	Name param.Opt[string] `json:"name,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// Billing contact information for a profile. Required when billing_model is
	// "profile" or "profile_and_organization".
	BillingContact ProfileNewParamsBillingContact `json:"billing_contact,omitzero"`
	// Brand and KYC data grouped into contact, business, and compliance sections
	Brand ProfileNewParamsBrand `json:"brand,omitzero"`
	// Payment card details for this profile (optional). Accepted when billing_model is
	// "profile" or "profile_and_organization". Not persisted on our servers —
	// forwarded to the payment processor.
	PaymentDetails ProfileNewParamsPaymentDetails `json:"payment_details,omitzero"`
	// Direct WhatsApp Business Account credentials for a profile. Use this when the
	// profile should have its own WhatsApp Business Account instead of inheriting from
	// the organization. Credentials must be obtained from Meta Business Manager by
	// creating a System User with whatsapp_business_messaging and
	// whatsapp_business_management scopes.
	WhatsappBusinessAccount ProfileNewParamsWhatsappBusinessAccount `json:"whatsapp_business_account,omitzero"`
	// contains filtered or unexported fields
}

func (ProfileNewParams) MarshalJSON added in v0.7.0

func (r ProfileNewParams) MarshalJSON() (data []byte, err error)

func (*ProfileNewParams) UnmarshalJSON added in v0.7.0

func (r *ProfileNewParams) UnmarshalJSON(data []byte) error

type ProfileNewParamsBillingContact added in v0.8.0

type ProfileNewParamsBillingContact struct {
	// Email address where invoices will be sent (required)
	Email string `json:"email" api:"required" format:"email"`
	// Full name of the billing contact or company (required)
	Name string `json:"name" api:"required"`
	// Billing address (optional). Free-form text including street, city, state, postal
	// code, and country.
	Address param.Opt[string] `json:"address,omitzero"`
	// Phone number for the billing contact (optional)
	Phone param.Opt[string] `json:"phone,omitzero"`
	// contains filtered or unexported fields
}

Billing contact information for a profile. Required when billing_model is "profile" or "profile_and_organization".

The properties Email, Name are required.

func (ProfileNewParamsBillingContact) MarshalJSON added in v0.8.0

func (r ProfileNewParamsBillingContact) MarshalJSON() (data []byte, err error)

func (*ProfileNewParamsBillingContact) UnmarshalJSON added in v0.8.0

func (r *ProfileNewParamsBillingContact) UnmarshalJSON(data []byte) error

type ProfileNewParamsBrand added in v0.23.0

type ProfileNewParamsBrand struct {
	// Compliance and TCR information for brand registration
	Compliance ProfileNewParamsBrandCompliance `json:"compliance,omitzero" api:"required"`
	// Contact information for brand KYC
	Contact ProfileNewParamsBrandContact `json:"contact,omitzero" api:"required"`
	// Business details and address for brand KYC
	Business ProfileNewParamsBrandBusiness `json:"business,omitzero"`
	// contains filtered or unexported fields
}

Brand and KYC data grouped into contact, business, and compliance sections

The properties Compliance, Contact are required.

func (ProfileNewParamsBrand) MarshalJSON added in v0.23.0

func (r ProfileNewParamsBrand) MarshalJSON() (data []byte, err error)

func (*ProfileNewParamsBrand) UnmarshalJSON added in v0.23.0

func (r *ProfileNewParamsBrand) UnmarshalJSON(data []byte) error

type ProfileNewParamsBrandBusiness added in v0.23.0

type ProfileNewParamsBrandBusiness struct {
	// City
	City param.Opt[string] `json:"city,omitzero"`
	// Country code (e.g., US, CA)
	Country param.Opt[string] `json:"country,omitzero"`
	// Country where the business is registered
	CountryOfRegistration param.Opt[string] `json:"countryOfRegistration,omitzero"`
	// Legal business name
	LegalName param.Opt[string] `json:"legalName,omitzero"`
	// Postal/ZIP code
	PostalCode param.Opt[string] `json:"postalCode,omitzero"`
	// State/province code
	State param.Opt[string] `json:"state,omitzero"`
	// Street address
	Street param.Opt[string] `json:"street,omitzero"`
	// Tax ID/EIN number
	TaxID param.Opt[string] `json:"taxId,omitzero"`
	// Type of tax ID (e.g., us_ein, ca_bn)
	TaxIDType param.Opt[string] `json:"taxIdType,omitzero"`
	// Business website URL
	URL param.Opt[string] `json:"url,omitzero" format:"uri"`
	// Any of "PRIVATE_PROFIT", "PUBLIC_PROFIT", "NON_PROFIT", "SOLE_PROPRIETOR",
	// "GOVERNMENT".
	EntityType string `json:"entityType,omitzero"`
	// contains filtered or unexported fields
}

Business details and address for brand KYC

func (ProfileNewParamsBrandBusiness) MarshalJSON added in v0.23.0

func (r ProfileNewParamsBrandBusiness) MarshalJSON() (data []byte, err error)

func (*ProfileNewParamsBrandBusiness) UnmarshalJSON added in v0.23.0

func (r *ProfileNewParamsBrandBusiness) UnmarshalJSON(data []byte) error

type ProfileNewParamsBrandCompliance added in v0.23.0

type ProfileNewParamsBrandCompliance struct {
	// Any of "BASIC_ACCOUNT", "MEDIUM_ACCOUNT", "LARGE_ACCOUNT", "SMALL_ACCOUNT",
	// "KEY_ACCOUNT".
	BrandRelationship TcrBrandRelationship `json:"brandRelationship,omitzero" api:"required"`
	// Any of "PROFESSIONAL", "REAL_ESTATE", "HEALTHCARE", "HUMAN_RESOURCES", "ENERGY",
	// "ENTERTAINMENT", "RETAIL", "TRANSPORTATION", "AGRICULTURE", "INSURANCE",
	// "POSTAL", "EDUCATION", "HOSPITALITY", "FINANCIAL", "POLITICAL", "GAMBLING",
	// "LEGAL", "CONSTRUCTION", "NGO", "MANUFACTURING", "GOVERNMENT", "TECHNOLOGY",
	// "COMMUNICATION".
	Vertical TcrVertical `json:"vertical,omitzero" api:"required"`
	// Whether this is a TCR (Campaign Registry) application
	IsTcrApplication param.Opt[bool] `json:"isTcrApplication,omitzero"`
	// Additional notes about the business or use case
	Notes param.Opt[string] `json:"notes,omitzero"`
	// Phone number prefix for messaging (e.g., "+1")
	PhoneNumberPrefix param.Opt[string] `json:"phoneNumberPrefix,omitzero"`
	// List of destination countries for messaging
	DestinationCountries []DestinationCountryParam `json:"destinationCountries,omitzero"`
	// contains filtered or unexported fields
}

Compliance and TCR information for brand registration

The properties BrandRelationship, Vertical are required.

func (ProfileNewParamsBrandCompliance) MarshalJSON added in v0.23.0

func (r ProfileNewParamsBrandCompliance) MarshalJSON() (data []byte, err error)

func (*ProfileNewParamsBrandCompliance) UnmarshalJSON added in v0.23.0

func (r *ProfileNewParamsBrandCompliance) UnmarshalJSON(data []byte) error

type ProfileNewParamsBrandContact added in v0.23.0

type ProfileNewParamsBrandContact struct {
	// Primary contact name (required)
	Name string `json:"name" api:"required"`
	// Business/brand name
	BusinessName param.Opt[string] `json:"businessName,omitzero"`
	// Contact email address
	Email param.Opt[string] `json:"email,omitzero" format:"email"`
	// Contact phone number in E.164 format
	Phone param.Opt[string] `json:"phone,omitzero"`
	// Contact phone country code (e.g., "1" for US)
	PhoneCountryCode param.Opt[string] `json:"phoneCountryCode,omitzero"`
	// Contact's role in the business
	Role param.Opt[string] `json:"role,omitzero"`
	// contains filtered or unexported fields
}

Contact information for brand KYC

The property Name is required.

func (ProfileNewParamsBrandContact) MarshalJSON added in v0.23.0

func (r ProfileNewParamsBrandContact) MarshalJSON() (data []byte, err error)

func (*ProfileNewParamsBrandContact) UnmarshalJSON added in v0.23.0

func (r *ProfileNewParamsBrandContact) UnmarshalJSON(data []byte) error

type ProfileNewParamsPaymentDetails added in v0.8.0

type ProfileNewParamsPaymentDetails struct {
	// Card number (digits only, 13–19 characters)
	CardNumber string `json:"card_number" api:"required"`
	// Card security code (3–4 digits)
	Cvc string `json:"cvc" api:"required"`
	// Card expiry date in MM/YY format (e.g. "09/27")
	Expiry string `json:"expiry" api:"required"`
	// Billing ZIP / postal code associated with the card
	ZipCode string `json:"zip_code" api:"required"`
	// contains filtered or unexported fields
}

Payment card details for this profile (optional). Accepted when billing_model is "profile" or "profile_and_organization". Not persisted on our servers — forwarded to the payment processor.

The properties CardNumber, Cvc, Expiry, ZipCode are required.

func (ProfileNewParamsPaymentDetails) MarshalJSON added in v0.8.0

func (r ProfileNewParamsPaymentDetails) MarshalJSON() (data []byte, err error)

func (*ProfileNewParamsPaymentDetails) UnmarshalJSON added in v0.8.0

func (r *ProfileNewParamsPaymentDetails) UnmarshalJSON(data []byte) error

type ProfileNewParamsWhatsappBusinessAccount added in v0.8.0

type ProfileNewParamsWhatsappBusinessAccount struct {
	// System User access token with whatsapp_business_messaging and
	// whatsapp_business_management permissions. This value is stored securely and
	// never returned in API responses.
	AccessToken string `json:"access_token" api:"required"`
	// WhatsApp Business Account ID from Meta Business Manager
	WabaID string `json:"waba_id" api:"required"`
	// Phone Number ID of an existing number already registered under this WABA in Meta
	// Business Manager. Optional — when omitted, a number will be provisioned from our
	// pool and registered in the WABA during the onboarding flow. When provided, the
	// number must already exist in the WABA.
	PhoneNumberID param.Opt[string] `json:"phone_number_id,omitzero"`
	// contains filtered or unexported fields
}

Direct WhatsApp Business Account credentials for a profile. Use this when the profile should have its own WhatsApp Business Account instead of inheriting from the organization. Credentials must be obtained from Meta Business Manager by creating a System User with whatsapp_business_messaging and whatsapp_business_management scopes.

The properties AccessToken, WabaID are required.

func (ProfileNewParamsWhatsappBusinessAccount) MarshalJSON added in v0.8.0

func (r ProfileNewParamsWhatsappBusinessAccount) MarshalJSON() (data []byte, err error)

func (*ProfileNewParamsWhatsappBusinessAccount) UnmarshalJSON added in v0.8.0

func (r *ProfileNewParamsWhatsappBusinessAccount) UnmarshalJSON(data []byte) error

type ProfileNewResponse added in v0.23.0

type ProfileNewResponse struct {
	// Detailed profile response for v3 API
	Data ProfileNewResponseData `json:"data" api:"nullable"`
	// Error information
	Error ProfileNewResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ProfileNewResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ProfileNewResponse) RawJSON added in v0.23.0

func (r ProfileNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileNewResponse) UnmarshalJSON added in v0.23.0

func (r *ProfileNewResponse) UnmarshalJSON(data []byte) error

type ProfileNewResponseData added in v0.23.0

type ProfileNewResponseData struct {
	// Profile unique identifier
	ID string `json:"id" format:"uuid"`
	// Always false. A profile no longer shares contacts with sibling profiles — it
	// sees only what it owns. Retained so existing v3 clients reading
	// allow_contact_sharing keep deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowContactSharing bool `json:"allow_contact_sharing" api:"nullable"`
	// Whether number changes are allowed during onboarding
	AllowNumberChangeDuringOnboarding bool `json:"allow_number_change_during_onboarding" api:"nullable"`
	// Always false. A profile no longer shares templates with sibling profiles.
	// Retained so existing v3 clients reading allow_template_sharing keep
	// deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowTemplateSharing bool `json:"allow_template_sharing" api:"nullable"`
	// Billing contact info returned in profile responses
	BillingContact ProfileNewResponseDataBillingContact `json:"billing_contact" api:"nullable"`
	// Billing model: profile, organization, or profile_and_organization
	BillingModel string `json:"billing_model"`
	// Brand response with nested contact, business, and compliance sections — mirrors
	// the request structure.
	Brand ProfileNewResponseDataBrand `json:"brand" api:"nullable"`
	// When the profile was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Profile description
	Description string `json:"description" api:"nullable"`
	// Profile email (inherited from organization)
	Email string `json:"email" api:"nullable"`
	// Profile icon URL
	Icon string `json:"icon" api:"nullable"`
	// Always false. A profile no longer inherits its organization's contacts. Retained
	// so existing v3 clients reading inherit_contacts keep deserializing; it carries
	// no information.
	//
	// Deprecated: deprecated
	InheritContacts bool `json:"inherit_contacts" api:"nullable"`
	// Whether this profile inherits TCR brand from the organization
	InheritTcrBrand bool `json:"inherit_tcr_brand"`
	// Whether this profile inherits TCR campaign from the organization
	InheritTcrCampaign bool `json:"inherit_tcr_campaign"`
	// Always false. A profile no longer inherits its organization's templates.
	// Retained so existing v3 clients reading inherit_templates keep deserializing; it
	// carries no information.
	//
	// Deprecated: deprecated
	InheritTemplates bool `json:"inherit_templates" api:"nullable"`
	// Profile name
	Name string `json:"name"`
	// Parent organization ID
	OrganizationID string `json:"organization_id" api:"nullable" format:"uuid"`
	// Direct SMS phone number
	SendingPhoneNumber string `json:"sending_phone_number" api:"nullable"`
	// Deprecated. Always null. Sender borrowing is gone: a profile no longer points at
	// another profile for its SMS sender, and every profile owns the sender it sends
	// from.
	//
	// Kept on the wire, and never populated, because those are two different promises.
	// Removing the key changes the response's shape — a generated client loses the
	// property and stops compiling on the next regenerate, for a value that is now
	// null for every profile in existence. Keeping it null costs a key and breaks
	// nobody, and null is the honest answer rather than a placeholder: there is no
	// borrowing left to report.
	//
	// Nothing could populate it. Migration 260813161500 dropped the column and copied
	// each borrower its own channel-provider row; its Down() says outright that the
	// borrower-to-lender pairing is not recoverable. The only surviving trace is a
	// notes string on the copied row.
	//
	// Deprecated: deprecated
	SendingPhoneNumberProfileID string `json:"sending_phone_number_profile_id" api:"nullable" format:"uuid"`
	// Deprecated: deprecated
	SendingWhatsappNumberProfileID string `json:"sending_whatsapp_number_profile_id" api:"nullable" format:"uuid"`
	// Profile short name/abbreviation. 3–11 characters: letters, numbers, and spaces
	// only, with at least one letter.
	ShortName string `json:"short_name" api:"nullable"`
	// Profile setup status: incomplete, pending_review, approved, rejected
	Status string `json:"status"`
	// When the profile was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// WhatsApp Business Account ID associated with this profile. Present whether the
	// WABA is inherited from the organization or configured directly.
	WabaID string `json:"waba_id" api:"nullable"`
	// Direct WhatsApp phone number
	WhatsappPhoneNumber string `json:"whatsapp_phone_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                                respjson.Field
		AllowContactSharing               respjson.Field
		AllowNumberChangeDuringOnboarding respjson.Field
		AllowTemplateSharing              respjson.Field
		BillingContact                    respjson.Field
		BillingModel                      respjson.Field
		Brand                             respjson.Field
		CreatedAt                         respjson.Field
		Description                       respjson.Field
		Email                             respjson.Field
		Icon                              respjson.Field
		InheritContacts                   respjson.Field
		InheritTcrBrand                   respjson.Field
		InheritTcrCampaign                respjson.Field
		InheritTemplates                  respjson.Field
		Name                              respjson.Field
		OrganizationID                    respjson.Field
		SendingPhoneNumber                respjson.Field
		SendingPhoneNumberProfileID       respjson.Field
		SendingWhatsappNumberProfileID    respjson.Field
		ShortName                         respjson.Field
		Status                            respjson.Field
		UpdatedAt                         respjson.Field
		WabaID                            respjson.Field
		WhatsappPhoneNumber               respjson.Field
		ExtraFields                       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detailed profile response for v3 API

func (ProfileNewResponseData) RawJSON added in v0.23.0

func (r ProfileNewResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileNewResponseData) UnmarshalJSON added in v0.23.0

func (r *ProfileNewResponseData) UnmarshalJSON(data []byte) error

type ProfileNewResponseDataBillingContact added in v0.23.0

type ProfileNewResponseDataBillingContact struct {
	Address string `json:"address" api:"nullable"`
	Email   string `json:"email" api:"nullable"`
	Name    string `json:"name" api:"nullable"`
	Phone   string `json:"phone" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address     respjson.Field
		Email       respjson.Field
		Name        respjson.Field
		Phone       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Billing contact info returned in profile responses

func (ProfileNewResponseDataBillingContact) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileNewResponseDataBillingContact) UnmarshalJSON added in v0.23.0

func (r *ProfileNewResponseDataBillingContact) UnmarshalJSON(data []byte) error

type ProfileNewResponseDataBrand added in v0.23.0

type ProfileNewResponseDataBrand struct {
	// Unique identifier for the brand
	ID string `json:"id" format:"uuid"`
	// Business details and address information
	Business ProfileNewResponseDataBrandBusiness `json:"business" api:"nullable"`
	// Compliance and TCR-related information
	Compliance ProfileNewResponseDataBrandCompliance `json:"compliance" api:"nullable"`
	// Contact information for the brand
	Contact ProfileNewResponseDataBrandContact `json:"contact" api:"nullable"`
	// When the brand was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Deprecated and scheduled for removal. Identifies the Campaign Service Provider
	// that registered the brand, which is Sent, so the value is the same for every
	// brand and every account. Nothing on your side can act on it and there is no
	// replacement. Stop reading it.
	//
	// Deprecated: deprecated
	CspID string `json:"csp_id" api:"nullable"`
	// Any of "SELF_DECLARED", "UNVERIFIED", "VERIFIED", "VETTED_VERIFIED".
	IdentityStatus string `json:"identity_status" api:"nullable"`
	// Whether this brand is inherited from the parent organization
	IsInherited bool `json:"is_inherited"`
	// Any of "ACTIVE", "INACTIVE", "SUSPENDED".
	Status string `json:"status" api:"nullable"`
	// When the brand was submitted to TCR
	SubmittedAt time.Time `json:"submitted_at" api:"nullable" format:"date-time"`
	// Whether this brand has been submitted to TCR
	SubmittedToTcr bool `json:"submitted_to_tcr"`
	// TCR brand ID (populated after TCR submission)
	TcrBrandID string `json:"tcr_brand_id" api:"nullable"`
	// Universal EIN from TCR
	UniversalEin string `json:"universal_ein" api:"nullable"`
	// When the brand was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Business       respjson.Field
		Compliance     respjson.Field
		Contact        respjson.Field
		CreatedAt      respjson.Field
		CspID          respjson.Field
		IdentityStatus respjson.Field
		IsInherited    respjson.Field
		Status         respjson.Field
		SubmittedAt    respjson.Field
		SubmittedToTcr respjson.Field
		TcrBrandID     respjson.Field
		UniversalEin   respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Brand response with nested contact, business, and compliance sections — mirrors the request structure.

func (ProfileNewResponseDataBrand) RawJSON added in v0.23.0

func (r ProfileNewResponseDataBrand) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileNewResponseDataBrand) UnmarshalJSON added in v0.23.0

func (r *ProfileNewResponseDataBrand) UnmarshalJSON(data []byte) error

type ProfileNewResponseDataBrandBusiness added in v0.23.0

type ProfileNewResponseDataBrandBusiness struct {
	// City
	City string `json:"city" api:"nullable"`
	// Country code (e.g., US, CA)
	Country string `json:"country" api:"nullable"`
	// Country where the business is registered
	CountryOfRegistration string `json:"country_of_registration" api:"nullable"`
	// Business entity type
	EntityType string `json:"entity_type" api:"nullable"`
	// Legal business name
	LegalName string `json:"legal_name" api:"nullable"`
	// Postal/ZIP code
	PostalCode string `json:"postal_code" api:"nullable"`
	// State/province code
	State string `json:"state" api:"nullable"`
	// Street address
	Street string `json:"street" api:"nullable"`
	// Tax ID/EIN number
	TaxID string `json:"tax_id" api:"nullable"`
	// Type of tax ID (e.g., us_ein, ca_bn)
	TaxIDType string `json:"tax_id_type" api:"nullable"`
	// Business website URL
	URL string `json:"url" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City                  respjson.Field
		Country               respjson.Field
		CountryOfRegistration respjson.Field
		EntityType            respjson.Field
		LegalName             respjson.Field
		PostalCode            respjson.Field
		State                 respjson.Field
		Street                respjson.Field
		TaxID                 respjson.Field
		TaxIDType             respjson.Field
		URL                   respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Business details and address information

func (ProfileNewResponseDataBrandBusiness) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileNewResponseDataBrandBusiness) UnmarshalJSON added in v0.23.0

func (r *ProfileNewResponseDataBrandBusiness) UnmarshalJSON(data []byte) error

type ProfileNewResponseDataBrandCompliance added in v0.23.0

type ProfileNewResponseDataBrandCompliance struct {
	// Any of "BASIC_ACCOUNT", "MEDIUM_ACCOUNT", "LARGE_ACCOUNT", "SMALL_ACCOUNT",
	// "KEY_ACCOUNT".
	BrandRelationship TcrBrandRelationship `json:"brand_relationship" api:"nullable"`
	// List of destination countries for messaging
	DestinationCountries []DestinationCountry `json:"destination_countries"`
	// Whether this is a TCR (Campaign Registry) application
	IsTcrApplication bool `json:"is_tcr_application"`
	// Additional notes about the business or use case
	Notes string `json:"notes" api:"nullable"`
	// Phone number prefix for messaging (e.g., "+1")
	PhoneNumberPrefix string `json:"phone_number_prefix" api:"nullable"`
	// Always null. The brand's free-text primary use case is no longer stored: it
	// reached neither TCR nor any decision, and its column is dropped with no
	// backfill, because the values were prose and the typed equivalent is the
	// campaign's MessagingUseCaseUS.
	//
	// Retained so existing v3 clients reading primary_use_case keep deserializing.
	// Unlike the profile sharing flags, which can answer false truthfully, there is no
	// value to report here — the field is present and empty rather than present and
	// wrong.
	//
	// Deprecated: deprecated
	PrimaryUseCase string `json:"primary_use_case" api:"nullable"`
	// Any of "PROFESSIONAL", "REAL_ESTATE", "HEALTHCARE", "HUMAN_RESOURCES", "ENERGY",
	// "ENTERTAINMENT", "RETAIL", "TRANSPORTATION", "AGRICULTURE", "INSURANCE",
	// "POSTAL", "EDUCATION", "HOSPITALITY", "FINANCIAL", "POLITICAL", "GAMBLING",
	// "LEGAL", "CONSTRUCTION", "NGO", "MANUFACTURING", "GOVERNMENT", "TECHNOLOGY",
	// "COMMUNICATION".
	Vertical TcrVertical `json:"vertical" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BrandRelationship    respjson.Field
		DestinationCountries respjson.Field
		IsTcrApplication     respjson.Field
		Notes                respjson.Field
		PhoneNumberPrefix    respjson.Field
		PrimaryUseCase       respjson.Field
		Vertical             respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compliance and TCR-related information

func (ProfileNewResponseDataBrandCompliance) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileNewResponseDataBrandCompliance) UnmarshalJSON added in v0.23.0

func (r *ProfileNewResponseDataBrandCompliance) UnmarshalJSON(data []byte) error

type ProfileNewResponseDataBrandContact added in v0.23.0

type ProfileNewResponseDataBrandContact struct {
	// Business/brand name
	BusinessName string `json:"business_name" api:"nullable"`
	// Contact email address
	Email string `json:"email" api:"nullable"`
	// Primary contact name
	Name string `json:"name"`
	// Contact phone number in E.164 format
	Phone string `json:"phone" api:"nullable"`
	// Contact phone country code (e.g., "1" for US)
	PhoneCountryCode string `json:"phone_country_code" api:"nullable"`
	// Contact's role in the business
	Role string `json:"role" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BusinessName     respjson.Field
		Email            respjson.Field
		Name             respjson.Field
		Phone            respjson.Field
		PhoneCountryCode respjson.Field
		Role             respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Contact information for the brand

func (ProfileNewResponseDataBrandContact) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileNewResponseDataBrandContact) UnmarshalJSON added in v0.23.0

func (r *ProfileNewResponseDataBrandContact) UnmarshalJSON(data []byte) error

type ProfileNewResponseError added in v0.23.0

type ProfileNewResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ProfileNewResponseError) RawJSON added in v0.23.0

func (r ProfileNewResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileNewResponseError) UnmarshalJSON added in v0.23.0

func (r *ProfileNewResponseError) UnmarshalJSON(data []byte) error

type ProfileNewResponseMeta added in v0.23.0

type ProfileNewResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ProfileNewResponseMeta) RawJSON added in v0.23.0

func (r ProfileNewResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileNewResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ProfileNewResponseMeta) UnmarshalJSON(data []byte) error

type ProfileService added in v0.7.0

type ProfileService struct {
	Options []option.RequestOption
	// **Deprecated — use Sender Profiles.**
	//
	// The original profile resource, kept because it has live callers. It still works,
	// and its replacement is `/v3/sender-profiles`, which takes the identity and the
	// campaign in one call instead of across three.
	//
	// New integrations should not start here.
	Campaigns ProfileCampaignService
}

**Deprecated — use Sender Profiles.**

The original profile resource, kept because it has live callers. It still works, and its replacement is `/v3/sender-profiles`, which takes the identity and the campaign in one call instead of across three.

New integrations should not start here.

ProfileService contains methods and other services that help with interacting with the Sent API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProfileService method instead.

func NewProfileService added in v0.7.0

func NewProfileService(opts ...option.RequestOption) (r ProfileService)

NewProfileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProfileService) Complete deprecated added in v0.7.0

func (r *ProfileService) Complete(ctx context.Context, profileID string, params ProfileCompleteParams, opts ...option.RequestOption) (res *ProfileCompleteResponse, err error)

**Deprecated.** This endpoint is replaced by `/v3/sender-profiles` and will be removed in a future release. It still behaves exactly as before, so nothing needs to change today — but new integrations should use `/v3/sender-profiles`, which models a profile's markets, compliance, brand, campaigns and billing explicitly.

Final step in the profile compliance workflow. Validates all prerequisites (KYC, brand, campaigns, required documents), connects the profile to the SMS and WhatsApp channels, and marks it onboarded. Prerequisites are always validated first: if any fail the call returns 400 naming every unmet one, and nothing is started. If they pass and the profile is already onboarded, the call returns 200 and does nothing. Otherwise it returns 202 and calls the provided webhook URL when background processing finishes.

Callable with the organization's API key or the profile's own key. The key's user must be an admin or owner of the profile, or of the organization it belongs to.

Prerequisites (all but the last are checked before the already-onboarded short-circuit, matching the previous contract; the last is checked after it, so a profile that is already onboarded is never rejected by it):

  • Profile must have a name, short name, and description (short name max 50 characters, description max 5000)
  • webHookUrl must be supplied on the request
  • A KYC form submission is required
  • A brand is required, either on the profile or inherited from the parent organization
  • TCR applications must have at least one campaign, own or inherited
  • Destination countries marked as main must have their required compliance documents uploaded
  • TCR applications must state whether they inherit the organization's TCR brand and campaign

Outcome:

  • Once the prerequisites pass and background processing succeeds, the profile's conversionFlowStatus becomes ONBOARDED and its public status reads `approved`
  • A profile with no WhatsApp channel, or one still awaiting TCR registration or country documents, is onboarded like any other. Those are answered by the brand and campaign records, not by a status on the profile
  • If background processing fails, the profile keeps the status it already had and the webhook reports the reason

Deprecated: deprecated

func (*ProfileService) Delete deprecated added in v0.7.0

func (r *ProfileService) Delete(ctx context.Context, profileID string, params ProfileDeleteParams, opts ...option.RequestOption) (err error)

**Deprecated.** This endpoint is replaced by `/v3/sender-profiles` and will be removed in a future release. It still behaves exactly as before, so nothing needs to change today — but new integrations should use `/v3/sender-profiles`, which models a profile's markets, compliance, brand, campaigns and billing explicitly.

Soft deletes a sender profile. The profile will be marked as deleted but data is retained. Anything it still held is released first: phone numbers return to our inventory and can go to whoever asks next, its own WhatsApp account is deregistered, and its routing rules stop being used. Requires admin role in the organization.

Deprecated: deprecated

func (*ProfileService) Get deprecated added in v0.7.0

func (r *ProfileService) Get(ctx context.Context, profileID string, query ProfileGetParams, opts ...option.RequestOption) (res *ProfileGetResponse, err error)

**Deprecated.** This endpoint is replaced by `/v3/sender-profiles` and will be removed in a future release. It still behaves exactly as before, so nothing needs to change today — but new integrations should use `/v3/sender-profiles`, which models a profile's markets, compliance, brand, campaigns and billing explicitly.

Retrieves detailed information about a specific sender profile within an organization, including brand and KYC information if a brand has been configured.

Deprecated: deprecated

func (*ProfileService) List deprecated added in v0.7.0

**Deprecated.** This endpoint is replaced by `/v3/sender-profiles` and will be removed in a future release. It still behaves exactly as before, so nothing needs to change today — but new integrations should use `/v3/sender-profiles`, which models a profile's markets, compliance, brand, campaigns and billing explicitly.

Retrieves all sender profiles within an organization, including brand information for each profile. Profiles represent different brands, departments, or use cases within an organization, each with their own messaging configuration.

Deprecated: deprecated

func (*ProfileService) New deprecated added in v0.7.0

**Deprecated.** This endpoint is replaced by `/v3/sender-profiles` and will be removed in a future release. It still behaves exactly as before, so nothing needs to change today — but new integrations should use `/v3/sender-profiles`, which models a profile's markets, compliance, brand, campaigns and billing explicitly.

Creates a new sender profile within an organization. Profiles represent different brands, departments, or use cases, each with their own messaging configuration and settings. Requires admin role in the organization.

## WhatsApp Business Account

Every profile owns its own WhatsApp Business Account — accounts are never shared between profiles or inherited from the organization. Provide a `whatsapp_business_account` object with `waba_id`, `phone_number_id`, and `access_token`. Obtain these from Meta Business Manager by creating a System User with `whatsapp_business_messaging` and `whatsapp_business_management` permissions.

Omit the field and the profile is created without WhatsApp, staying incomplete until it has an account of its own.

## Brand

Include the optional `brand` field to create the brand for this profile at the same time. Cannot be used when `inherit_tcr_brand` is `true`.

## Payment Details

When `billing_model` is `"profile"` or `"profile_and_organization"` you may include a `payment_details` object containing the card number, expiry (MM/YY), CVC, and billing ZIP code. Payment details are **never stored** on our servers and are forwarded directly to the payment processor. Providing `payment_details` when `billing_model` is `"organization"` is not allowed.

Deprecated: deprecated

func (*ProfileService) Update deprecated added in v0.7.0

func (r *ProfileService) Update(ctx context.Context, profileID string, params ProfileUpdateParams, opts ...option.RequestOption) (res *ProfileUpdateResponse, err error)

**Deprecated.** This endpoint is replaced by `/v3/sender-profiles` and will be removed in a future release. It still behaves exactly as before, so nothing needs to change today — but new integrations should use `/v3/sender-profiles`, which models a profile's markets, compliance, brand, campaigns and billing explicitly.

Updates a profile's configuration and settings. Requires admin role in the organization. Only provided fields will be updated (partial update).

## Brand Management

Include the optional `brand` field to create or update the brand associated with this profile. The brand holds KYC and TCR compliance data (legal business info, contact details, messaging vertical). Once a brand has been submitted to TCR it cannot be modified. Setting `inherit_tcr_brand: true` and providing `brand` in the same request is not allowed.

## Payment Details

When `billing_model` is `"profile"` or `"profile_and_organization"` you may include a `payment_details` object containing the card number, expiry (MM/YY), CVC, and billing ZIP code. Payment details are **never stored** on our servers and are forwarded directly to the payment processor. Providing `payment_details` when `billing_model` is `"organization"` is not allowed.

## Deprecated fields

`sending_phone_number_profile_id` and `sending_whatsapp_number_profile_id` are **accepted and ignored**. Sender borrowing is gone: a profile cannot send from another profile's number, because two profiles behind one sender makes an inbound reply and a delivery receipt ambiguous about whose they are.

Sending either **changes nothing and still returns `200`** — they are kept on the contract so an existing integration keeps working. Reads carry both keys too and always answer `null`, which is how you can confirm the value did not take.

Give the profile a sender of its own instead — `POST /v3/channels/sms` or `POST /v3/channels/whatsapp`, sent with the `x-profile-id` header naming it.

Deprecated: deprecated

type ProfileUpdateParams added in v0.7.0

type ProfileUpdateParams struct {
	// Deprecated. Accepted and ignored. Contact and template sharing between sender
	// profiles is gone — a profile sees only what it owns, and the organization still
	// sees all of its profiles' contacts and templates through read-time widening. The
	// four columns behind these flags were dropped by M260720120000.
	//
	// Retired the same way as SendingPhoneNumberProfileId, and for the same reason:
	// the properties stay bound so an SDK that assigns them keeps compiling, and a 400
	// would break a working integration over a capability that is gone regardless.
	// Every profile reports all four as false, so a caller that checks its own write
	// can see it did not take.
	AllowContactSharing param.Opt[bool] `json:"allow_contact_sharing,omitzero"`
	// Whether number changes are allowed during onboarding (optional)
	AllowNumberChangeDuringOnboarding param.Opt[bool] `json:"allow_number_change_during_onboarding,omitzero"`
	AllowTemplateSharing              param.Opt[bool] `json:"allow_template_sharing,omitzero"`
	// Billing model: profile, organization, or profile_and_organization (optional).
	//
	//   - "organization": the organization's billing details are used; no profile-level
	//     billing info needed.
	//   - "profile": the profile is billed independently; billing_contact is required.
	//   - "profile_and_organization": the profile is billed first with the organization
	//     as fallback; billing_contact is required.
	BillingModel param.Opt[string] `json:"billing_model,omitzero"`
	// Profile description (optional)
	Description param.Opt[string] `json:"description,omitzero"`
	// Profile icon URL (optional)
	Icon            param.Opt[string] `json:"icon,omitzero"`
	InheritContacts param.Opt[bool]   `json:"inherit_contacts,omitzero"`
	// Whether this profile inherits TCR brand from organization (optional)
	InheritTcrBrand param.Opt[bool] `json:"inherit_tcr_brand,omitzero"`
	// Whether this profile inherits TCR campaign from organization (optional)
	InheritTcrCampaign param.Opt[bool] `json:"inherit_tcr_campaign,omitzero"`
	InheritTemplates   param.Opt[bool] `json:"inherit_templates,omitzero"`
	// Profile name (optional)
	Name param.Opt[string] `json:"name,omitzero"`
	// Direct phone number for SMS sending (optional)
	SendingPhoneNumber param.Opt[string] `json:"sending_phone_number,omitzero"`
	// Deprecated. Accepted and ignored. Sender borrowing is gone: a profile cannot
	// send from another profile's SMS number. Supplying this changes nothing and the
	// request still succeeds.
	//
	// Bound rather than dropped so the property survives on the wire and in a
	// generated client — an SDK that assigns it keeps compiling, which is the
	// compatibility this exists for. It is deliberately not refused: a 400 here would
	// break an integration that is otherwise working, and the capability it asks for
	// is gone either way.
	//
	// The trade-off, stated plainly. A caller asking for borrowing is told it
	// succeeded when nothing happened. What makes that survivable is the read:
	// sending_phone_number_profile_id comes back null on every profile, so a caller
	// that checks its own write can see it did not take. Every request that carries
	// one is logged, so we can tell when nobody is sending it any more and the field
	// can go for real.
	//
	// Give the profile a sender of its own instead: POST /v3/channels/sms with the
	// x-profile-id header naming it.
	SendingPhoneNumberProfileID    param.Opt[string] `json:"sending_phone_number_profile_id,omitzero" format:"uuid"`
	SendingWhatsappNumberProfileID param.Opt[string] `json:"sending_whatsapp_number_profile_id,omitzero" format:"uuid"`
	// Profile short name/abbreviation (optional). Must be 3–11 characters, contain
	// only letters, numbers, and spaces, and include at least one letter. Example:
	// "SALES", "Mkt 2", "Support1".
	ShortName param.Opt[string] `json:"short_name,omitzero"`
	// Direct phone number for WhatsApp sending (optional)
	WhatsappPhoneNumber param.Opt[string] `json:"whatsapp_phone_number,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// Billing contact information for a profile. Required when billing_model is
	// "profile" or "profile_and_organization".
	BillingContact ProfileUpdateParamsBillingContact `json:"billing_contact,omitzero"`
	// Brand and KYC data grouped into contact, business, and compliance sections
	Brand ProfileUpdateParamsBrand `json:"brand,omitzero"`
	// Payment card details for this profile (optional). Accepted when billing_model is
	// "profile" or "profile_and_organization". Not persisted on our servers —
	// forwarded to the payment processor.
	PaymentDetails ProfileUpdateParamsPaymentDetails `json:"payment_details,omitzero"`
	// contains filtered or unexported fields
}

func (ProfileUpdateParams) MarshalJSON added in v0.7.0

func (r ProfileUpdateParams) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParams) UnmarshalJSON added in v0.7.0

func (r *ProfileUpdateParams) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsBillingContact added in v0.8.0

type ProfileUpdateParamsBillingContact struct {
	// Email address where invoices will be sent (required)
	Email string `json:"email" api:"required" format:"email"`
	// Full name of the billing contact or company (required)
	Name string `json:"name" api:"required"`
	// Billing address (optional). Free-form text including street, city, state, postal
	// code, and country.
	Address param.Opt[string] `json:"address,omitzero"`
	// Phone number for the billing contact (optional)
	Phone param.Opt[string] `json:"phone,omitzero"`
	// contains filtered or unexported fields
}

Billing contact information for a profile. Required when billing_model is "profile" or "profile_and_organization".

The properties Email, Name are required.

func (ProfileUpdateParamsBillingContact) MarshalJSON added in v0.8.0

func (r ProfileUpdateParamsBillingContact) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsBillingContact) UnmarshalJSON added in v0.8.0

func (r *ProfileUpdateParamsBillingContact) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsBrand added in v0.23.0

type ProfileUpdateParamsBrand struct {
	// Compliance and TCR information for brand registration
	Compliance ProfileUpdateParamsBrandCompliance `json:"compliance,omitzero" api:"required"`
	// Contact information for brand KYC
	Contact ProfileUpdateParamsBrandContact `json:"contact,omitzero" api:"required"`
	// Business details and address for brand KYC
	Business ProfileUpdateParamsBrandBusiness `json:"business,omitzero"`
	// contains filtered or unexported fields
}

Brand and KYC data grouped into contact, business, and compliance sections

The properties Compliance, Contact are required.

func (ProfileUpdateParamsBrand) MarshalJSON added in v0.23.0

func (r ProfileUpdateParamsBrand) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsBrand) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateParamsBrand) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsBrandBusiness added in v0.23.0

type ProfileUpdateParamsBrandBusiness struct {
	// City
	City param.Opt[string] `json:"city,omitzero"`
	// Country code (e.g., US, CA)
	Country param.Opt[string] `json:"country,omitzero"`
	// Country where the business is registered
	CountryOfRegistration param.Opt[string] `json:"countryOfRegistration,omitzero"`
	// Legal business name
	LegalName param.Opt[string] `json:"legalName,omitzero"`
	// Postal/ZIP code
	PostalCode param.Opt[string] `json:"postalCode,omitzero"`
	// State/province code
	State param.Opt[string] `json:"state,omitzero"`
	// Street address
	Street param.Opt[string] `json:"street,omitzero"`
	// Tax ID/EIN number
	TaxID param.Opt[string] `json:"taxId,omitzero"`
	// Type of tax ID (e.g., us_ein, ca_bn)
	TaxIDType param.Opt[string] `json:"taxIdType,omitzero"`
	// Business website URL
	URL param.Opt[string] `json:"url,omitzero" format:"uri"`
	// Any of "PRIVATE_PROFIT", "PUBLIC_PROFIT", "NON_PROFIT", "SOLE_PROPRIETOR",
	// "GOVERNMENT".
	EntityType string `json:"entityType,omitzero"`
	// contains filtered or unexported fields
}

Business details and address for brand KYC

func (ProfileUpdateParamsBrandBusiness) MarshalJSON added in v0.23.0

func (r ProfileUpdateParamsBrandBusiness) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsBrandBusiness) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateParamsBrandBusiness) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsBrandCompliance added in v0.23.0

type ProfileUpdateParamsBrandCompliance struct {
	// Any of "BASIC_ACCOUNT", "MEDIUM_ACCOUNT", "LARGE_ACCOUNT", "SMALL_ACCOUNT",
	// "KEY_ACCOUNT".
	BrandRelationship TcrBrandRelationship `json:"brandRelationship,omitzero" api:"required"`
	// Any of "PROFESSIONAL", "REAL_ESTATE", "HEALTHCARE", "HUMAN_RESOURCES", "ENERGY",
	// "ENTERTAINMENT", "RETAIL", "TRANSPORTATION", "AGRICULTURE", "INSURANCE",
	// "POSTAL", "EDUCATION", "HOSPITALITY", "FINANCIAL", "POLITICAL", "GAMBLING",
	// "LEGAL", "CONSTRUCTION", "NGO", "MANUFACTURING", "GOVERNMENT", "TECHNOLOGY",
	// "COMMUNICATION".
	Vertical TcrVertical `json:"vertical,omitzero" api:"required"`
	// Whether this is a TCR (Campaign Registry) application
	IsTcrApplication param.Opt[bool] `json:"isTcrApplication,omitzero"`
	// Additional notes about the business or use case
	Notes param.Opt[string] `json:"notes,omitzero"`
	// Phone number prefix for messaging (e.g., "+1")
	PhoneNumberPrefix param.Opt[string] `json:"phoneNumberPrefix,omitzero"`
	// List of destination countries for messaging
	DestinationCountries []DestinationCountryParam `json:"destinationCountries,omitzero"`
	// contains filtered or unexported fields
}

Compliance and TCR information for brand registration

The properties BrandRelationship, Vertical are required.

func (ProfileUpdateParamsBrandCompliance) MarshalJSON added in v0.23.0

func (r ProfileUpdateParamsBrandCompliance) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsBrandCompliance) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateParamsBrandCompliance) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsBrandContact added in v0.23.0

type ProfileUpdateParamsBrandContact struct {
	// Primary contact name (required)
	Name string `json:"name" api:"required"`
	// Business/brand name
	BusinessName param.Opt[string] `json:"businessName,omitzero"`
	// Contact email address
	Email param.Opt[string] `json:"email,omitzero" format:"email"`
	// Contact phone number in E.164 format
	Phone param.Opt[string] `json:"phone,omitzero"`
	// Contact phone country code (e.g., "1" for US)
	PhoneCountryCode param.Opt[string] `json:"phoneCountryCode,omitzero"`
	// Contact's role in the business
	Role param.Opt[string] `json:"role,omitzero"`
	// contains filtered or unexported fields
}

Contact information for brand KYC

The property Name is required.

func (ProfileUpdateParamsBrandContact) MarshalJSON added in v0.23.0

func (r ProfileUpdateParamsBrandContact) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsBrandContact) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateParamsBrandContact) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsPaymentDetails added in v0.8.0

type ProfileUpdateParamsPaymentDetails struct {
	// Card number (digits only, 13–19 characters)
	CardNumber string `json:"card_number" api:"required"`
	// Card security code (3–4 digits)
	Cvc string `json:"cvc" api:"required"`
	// Card expiry date in MM/YY format (e.g. "09/27")
	Expiry string `json:"expiry" api:"required"`
	// Billing ZIP / postal code associated with the card
	ZipCode string `json:"zip_code" api:"required"`
	// contains filtered or unexported fields
}

Payment card details for this profile (optional). Accepted when billing_model is "profile" or "profile_and_organization". Not persisted on our servers — forwarded to the payment processor.

The properties CardNumber, Cvc, Expiry, ZipCode are required.

func (ProfileUpdateParamsPaymentDetails) MarshalJSON added in v0.8.0

func (r ProfileUpdateParamsPaymentDetails) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsPaymentDetails) UnmarshalJSON added in v0.8.0

func (r *ProfileUpdateParamsPaymentDetails) UnmarshalJSON(data []byte) error

type ProfileUpdateResponse added in v0.23.0

type ProfileUpdateResponse struct {
	// Detailed profile response for v3 API
	Data ProfileUpdateResponseData `json:"data" api:"nullable"`
	// Error information
	Error ProfileUpdateResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta ProfileUpdateResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (ProfileUpdateResponse) RawJSON added in v0.23.0

func (r ProfileUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponse) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateResponse) UnmarshalJSON(data []byte) error

type ProfileUpdateResponseData added in v0.23.0

type ProfileUpdateResponseData struct {
	// Profile unique identifier
	ID string `json:"id" format:"uuid"`
	// Always false. A profile no longer shares contacts with sibling profiles — it
	// sees only what it owns. Retained so existing v3 clients reading
	// allow_contact_sharing keep deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowContactSharing bool `json:"allow_contact_sharing" api:"nullable"`
	// Whether number changes are allowed during onboarding
	AllowNumberChangeDuringOnboarding bool `json:"allow_number_change_during_onboarding" api:"nullable"`
	// Always false. A profile no longer shares templates with sibling profiles.
	// Retained so existing v3 clients reading allow_template_sharing keep
	// deserializing; it carries no information.
	//
	// Deprecated: deprecated
	AllowTemplateSharing bool `json:"allow_template_sharing" api:"nullable"`
	// Billing contact info returned in profile responses
	BillingContact ProfileUpdateResponseDataBillingContact `json:"billing_contact" api:"nullable"`
	// Billing model: profile, organization, or profile_and_organization
	BillingModel string `json:"billing_model"`
	// Brand response with nested contact, business, and compliance sections — mirrors
	// the request structure.
	Brand ProfileUpdateResponseDataBrand `json:"brand" api:"nullable"`
	// When the profile was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Profile description
	Description string `json:"description" api:"nullable"`
	// Profile email (inherited from organization)
	Email string `json:"email" api:"nullable"`
	// Profile icon URL
	Icon string `json:"icon" api:"nullable"`
	// Always false. A profile no longer inherits its organization's contacts. Retained
	// so existing v3 clients reading inherit_contacts keep deserializing; it carries
	// no information.
	//
	// Deprecated: deprecated
	InheritContacts bool `json:"inherit_contacts" api:"nullable"`
	// Whether this profile inherits TCR brand from the organization
	InheritTcrBrand bool `json:"inherit_tcr_brand"`
	// Whether this profile inherits TCR campaign from the organization
	InheritTcrCampaign bool `json:"inherit_tcr_campaign"`
	// Always false. A profile no longer inherits its organization's templates.
	// Retained so existing v3 clients reading inherit_templates keep deserializing; it
	// carries no information.
	//
	// Deprecated: deprecated
	InheritTemplates bool `json:"inherit_templates" api:"nullable"`
	// Profile name
	Name string `json:"name"`
	// Parent organization ID
	OrganizationID string `json:"organization_id" api:"nullable" format:"uuid"`
	// Direct SMS phone number
	SendingPhoneNumber string `json:"sending_phone_number" api:"nullable"`
	// Deprecated. Always null. Sender borrowing is gone: a profile no longer points at
	// another profile for its SMS sender, and every profile owns the sender it sends
	// from.
	//
	// Kept on the wire, and never populated, because those are two different promises.
	// Removing the key changes the response's shape — a generated client loses the
	// property and stops compiling on the next regenerate, for a value that is now
	// null for every profile in existence. Keeping it null costs a key and breaks
	// nobody, and null is the honest answer rather than a placeholder: there is no
	// borrowing left to report.
	//
	// Nothing could populate it. Migration 260813161500 dropped the column and copied
	// each borrower its own channel-provider row; its Down() says outright that the
	// borrower-to-lender pairing is not recoverable. The only surviving trace is a
	// notes string on the copied row.
	//
	// Deprecated: deprecated
	SendingPhoneNumberProfileID string `json:"sending_phone_number_profile_id" api:"nullable" format:"uuid"`
	// Deprecated: deprecated
	SendingWhatsappNumberProfileID string `json:"sending_whatsapp_number_profile_id" api:"nullable" format:"uuid"`
	// Profile short name/abbreviation. 3–11 characters: letters, numbers, and spaces
	// only, with at least one letter.
	ShortName string `json:"short_name" api:"nullable"`
	// Profile setup status: incomplete, pending_review, approved, rejected
	Status string `json:"status"`
	// When the profile was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// WhatsApp Business Account ID associated with this profile. Present whether the
	// WABA is inherited from the organization or configured directly.
	WabaID string `json:"waba_id" api:"nullable"`
	// Direct WhatsApp phone number
	WhatsappPhoneNumber string `json:"whatsapp_phone_number" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                                respjson.Field
		AllowContactSharing               respjson.Field
		AllowNumberChangeDuringOnboarding respjson.Field
		AllowTemplateSharing              respjson.Field
		BillingContact                    respjson.Field
		BillingModel                      respjson.Field
		Brand                             respjson.Field
		CreatedAt                         respjson.Field
		Description                       respjson.Field
		Email                             respjson.Field
		Icon                              respjson.Field
		InheritContacts                   respjson.Field
		InheritTcrBrand                   respjson.Field
		InheritTcrCampaign                respjson.Field
		InheritTemplates                  respjson.Field
		Name                              respjson.Field
		OrganizationID                    respjson.Field
		SendingPhoneNumber                respjson.Field
		SendingPhoneNumberProfileID       respjson.Field
		SendingWhatsappNumberProfileID    respjson.Field
		ShortName                         respjson.Field
		Status                            respjson.Field
		UpdatedAt                         respjson.Field
		WabaID                            respjson.Field
		WhatsappPhoneNumber               respjson.Field
		ExtraFields                       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detailed profile response for v3 API

func (ProfileUpdateResponseData) RawJSON added in v0.23.0

func (r ProfileUpdateResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponseData) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateResponseData) UnmarshalJSON(data []byte) error

type ProfileUpdateResponseDataBillingContact added in v0.23.0

type ProfileUpdateResponseDataBillingContact struct {
	Address string `json:"address" api:"nullable"`
	Email   string `json:"email" api:"nullable"`
	Name    string `json:"name" api:"nullable"`
	Phone   string `json:"phone" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address     respjson.Field
		Email       respjson.Field
		Name        respjson.Field
		Phone       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Billing contact info returned in profile responses

func (ProfileUpdateResponseDataBillingContact) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponseDataBillingContact) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateResponseDataBillingContact) UnmarshalJSON(data []byte) error

type ProfileUpdateResponseDataBrand added in v0.23.0

type ProfileUpdateResponseDataBrand struct {
	// Unique identifier for the brand
	ID string `json:"id" format:"uuid"`
	// Business details and address information
	Business ProfileUpdateResponseDataBrandBusiness `json:"business" api:"nullable"`
	// Compliance and TCR-related information
	Compliance ProfileUpdateResponseDataBrandCompliance `json:"compliance" api:"nullable"`
	// Contact information for the brand
	Contact ProfileUpdateResponseDataBrandContact `json:"contact" api:"nullable"`
	// When the brand was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Deprecated and scheduled for removal. Identifies the Campaign Service Provider
	// that registered the brand, which is Sent, so the value is the same for every
	// brand and every account. Nothing on your side can act on it and there is no
	// replacement. Stop reading it.
	//
	// Deprecated: deprecated
	CspID string `json:"csp_id" api:"nullable"`
	// Any of "SELF_DECLARED", "UNVERIFIED", "VERIFIED", "VETTED_VERIFIED".
	IdentityStatus string `json:"identity_status" api:"nullable"`
	// Whether this brand is inherited from the parent organization
	IsInherited bool `json:"is_inherited"`
	// Any of "ACTIVE", "INACTIVE", "SUSPENDED".
	Status string `json:"status" api:"nullable"`
	// When the brand was submitted to TCR
	SubmittedAt time.Time `json:"submitted_at" api:"nullable" format:"date-time"`
	// Whether this brand has been submitted to TCR
	SubmittedToTcr bool `json:"submitted_to_tcr"`
	// TCR brand ID (populated after TCR submission)
	TcrBrandID string `json:"tcr_brand_id" api:"nullable"`
	// Universal EIN from TCR
	UniversalEin string `json:"universal_ein" api:"nullable"`
	// When the brand was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Business       respjson.Field
		Compliance     respjson.Field
		Contact        respjson.Field
		CreatedAt      respjson.Field
		CspID          respjson.Field
		IdentityStatus respjson.Field
		IsInherited    respjson.Field
		Status         respjson.Field
		SubmittedAt    respjson.Field
		SubmittedToTcr respjson.Field
		TcrBrandID     respjson.Field
		UniversalEin   respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Brand response with nested contact, business, and compliance sections — mirrors the request structure.

func (ProfileUpdateResponseDataBrand) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponseDataBrand) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateResponseDataBrand) UnmarshalJSON(data []byte) error

type ProfileUpdateResponseDataBrandBusiness added in v0.23.0

type ProfileUpdateResponseDataBrandBusiness struct {
	// City
	City string `json:"city" api:"nullable"`
	// Country code (e.g., US, CA)
	Country string `json:"country" api:"nullable"`
	// Country where the business is registered
	CountryOfRegistration string `json:"country_of_registration" api:"nullable"`
	// Business entity type
	EntityType string `json:"entity_type" api:"nullable"`
	// Legal business name
	LegalName string `json:"legal_name" api:"nullable"`
	// Postal/ZIP code
	PostalCode string `json:"postal_code" api:"nullable"`
	// State/province code
	State string `json:"state" api:"nullable"`
	// Street address
	Street string `json:"street" api:"nullable"`
	// Tax ID/EIN number
	TaxID string `json:"tax_id" api:"nullable"`
	// Type of tax ID (e.g., us_ein, ca_bn)
	TaxIDType string `json:"tax_id_type" api:"nullable"`
	// Business website URL
	URL string `json:"url" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City                  respjson.Field
		Country               respjson.Field
		CountryOfRegistration respjson.Field
		EntityType            respjson.Field
		LegalName             respjson.Field
		PostalCode            respjson.Field
		State                 respjson.Field
		Street                respjson.Field
		TaxID                 respjson.Field
		TaxIDType             respjson.Field
		URL                   respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Business details and address information

func (ProfileUpdateResponseDataBrandBusiness) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponseDataBrandBusiness) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateResponseDataBrandBusiness) UnmarshalJSON(data []byte) error

type ProfileUpdateResponseDataBrandCompliance added in v0.23.0

type ProfileUpdateResponseDataBrandCompliance struct {
	// Any of "BASIC_ACCOUNT", "MEDIUM_ACCOUNT", "LARGE_ACCOUNT", "SMALL_ACCOUNT",
	// "KEY_ACCOUNT".
	BrandRelationship TcrBrandRelationship `json:"brand_relationship" api:"nullable"`
	// List of destination countries for messaging
	DestinationCountries []DestinationCountry `json:"destination_countries"`
	// Whether this is a TCR (Campaign Registry) application
	IsTcrApplication bool `json:"is_tcr_application"`
	// Additional notes about the business or use case
	Notes string `json:"notes" api:"nullable"`
	// Phone number prefix for messaging (e.g., "+1")
	PhoneNumberPrefix string `json:"phone_number_prefix" api:"nullable"`
	// Always null. The brand's free-text primary use case is no longer stored: it
	// reached neither TCR nor any decision, and its column is dropped with no
	// backfill, because the values were prose and the typed equivalent is the
	// campaign's MessagingUseCaseUS.
	//
	// Retained so existing v3 clients reading primary_use_case keep deserializing.
	// Unlike the profile sharing flags, which can answer false truthfully, there is no
	// value to report here — the field is present and empty rather than present and
	// wrong.
	//
	// Deprecated: deprecated
	PrimaryUseCase string `json:"primary_use_case" api:"nullable"`
	// Any of "PROFESSIONAL", "REAL_ESTATE", "HEALTHCARE", "HUMAN_RESOURCES", "ENERGY",
	// "ENTERTAINMENT", "RETAIL", "TRANSPORTATION", "AGRICULTURE", "INSURANCE",
	// "POSTAL", "EDUCATION", "HOSPITALITY", "FINANCIAL", "POLITICAL", "GAMBLING",
	// "LEGAL", "CONSTRUCTION", "NGO", "MANUFACTURING", "GOVERNMENT", "TECHNOLOGY",
	// "COMMUNICATION".
	Vertical TcrVertical `json:"vertical" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BrandRelationship    respjson.Field
		DestinationCountries respjson.Field
		IsTcrApplication     respjson.Field
		Notes                respjson.Field
		PhoneNumberPrefix    respjson.Field
		PrimaryUseCase       respjson.Field
		Vertical             respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compliance and TCR-related information

func (ProfileUpdateResponseDataBrandCompliance) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponseDataBrandCompliance) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateResponseDataBrandCompliance) UnmarshalJSON(data []byte) error

type ProfileUpdateResponseDataBrandContact added in v0.23.0

type ProfileUpdateResponseDataBrandContact struct {
	// Business/brand name
	BusinessName string `json:"business_name" api:"nullable"`
	// Contact email address
	Email string `json:"email" api:"nullable"`
	// Primary contact name
	Name string `json:"name"`
	// Contact phone number in E.164 format
	Phone string `json:"phone" api:"nullable"`
	// Contact phone country code (e.g., "1" for US)
	PhoneCountryCode string `json:"phone_country_code" api:"nullable"`
	// Contact's role in the business
	Role string `json:"role" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BusinessName     respjson.Field
		Email            respjson.Field
		Name             respjson.Field
		Phone            respjson.Field
		PhoneCountryCode respjson.Field
		Role             respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Contact information for the brand

func (ProfileUpdateResponseDataBrandContact) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponseDataBrandContact) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateResponseDataBrandContact) UnmarshalJSON(data []byte) error

type ProfileUpdateResponseError added in v0.23.0

type ProfileUpdateResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (ProfileUpdateResponseError) RawJSON added in v0.23.0

func (r ProfileUpdateResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponseError) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateResponseError) UnmarshalJSON(data []byte) error

type ProfileUpdateResponseMeta added in v0.23.0

type ProfileUpdateResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (ProfileUpdateResponseMeta) RawJSON added in v0.23.0

func (r ProfileUpdateResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponseMeta) UnmarshalJSON added in v0.23.0

func (r *ProfileUpdateResponseMeta) UnmarshalJSON(data []byte) error

type TcrBrandRelationship added in v0.7.0

type TcrBrandRelationship string
const (
	TcrBrandRelationshipBasicAccount  TcrBrandRelationship = "BASIC_ACCOUNT"
	TcrBrandRelationshipMediumAccount TcrBrandRelationship = "MEDIUM_ACCOUNT"
	TcrBrandRelationshipLargeAccount  TcrBrandRelationship = "LARGE_ACCOUNT"
	TcrBrandRelationshipSmallAccount  TcrBrandRelationship = "SMALL_ACCOUNT"
	TcrBrandRelationshipKeyAccount    TcrBrandRelationship = "KEY_ACCOUNT"
)

type TcrVertical added in v0.7.0

type TcrVertical string
const (
	TcrVerticalProfessional   TcrVertical = "PROFESSIONAL"
	TcrVerticalRealEstate     TcrVertical = "REAL_ESTATE"
	TcrVerticalHealthcare     TcrVertical = "HEALTHCARE"
	TcrVerticalHumanResources TcrVertical = "HUMAN_RESOURCES"
	TcrVerticalEnergy         TcrVertical = "ENERGY"
	TcrVerticalEntertainment  TcrVertical = "ENTERTAINMENT"
	TcrVerticalRetail         TcrVertical = "RETAIL"
	TcrVerticalTransportation TcrVertical = "TRANSPORTATION"
	TcrVerticalAgriculture    TcrVertical = "AGRICULTURE"
	TcrVerticalInsurance      TcrVertical = "INSURANCE"
	TcrVerticalPostal         TcrVertical = "POSTAL"
	TcrVerticalEducation      TcrVertical = "EDUCATION"
	TcrVerticalHospitality    TcrVertical = "HOSPITALITY"
	TcrVerticalFinancial      TcrVertical = "FINANCIAL"
	TcrVerticalPolitical      TcrVertical = "POLITICAL"
	TcrVerticalGambling       TcrVertical = "GAMBLING"
	TcrVerticalLegal          TcrVertical = "LEGAL"
	TcrVerticalConstruction   TcrVertical = "CONSTRUCTION"
	TcrVerticalNgo            TcrVertical = "NGO"
	TcrVerticalManufacturing  TcrVertical = "MANUFACTURING"
	TcrVerticalGovernment     TcrVertical = "GOVERNMENT"
	TcrVerticalTechnology     TcrVertical = "TECHNOLOGY"
	TcrVerticalCommunication  TcrVertical = "COMMUNICATION"
)

type TemplateBodyContentParam

type TemplateBodyContentParam struct {
	Template  string                  `json:"template" api:"required"`
	Type      param.Opt[string]       `json:"type,omitzero"`
	Variables []TemplateVariableParam `json:"variables,omitzero"`
	// contains filtered or unexported fields
}

The property Template is required.

func (TemplateBodyContentParam) MarshalJSON

func (r TemplateBodyContentParam) MarshalJSON() (data []byte, err error)

func (*TemplateBodyContentParam) UnmarshalJSON

func (r *TemplateBodyContentParam) UnmarshalJSON(data []byte) error

type TemplateBodyParam added in v0.30.0

type TemplateBodyParam struct {
	// Content that will be used for all channels (SMS and WhatsApp) unless
	// channel-specific content is provided
	MultiChannel TemplateBodyContentParam `json:"multiChannel,omitzero"`
	// RCS-specific content that overrides multi-channel content for RCS messages
	Rcs TemplateBodyContentParam `json:"rcs,omitzero"`
	// SMS-specific content that overrides multi-channel content for SMS messages
	SMS TemplateBodyContentParam `json:"sms,omitzero"`
	// WhatsApp-specific content that overrides multi-channel content for WhatsApp
	// messages
	Whatsapp TemplateBodyContentParam `json:"whatsapp,omitzero"`
	// contains filtered or unexported fields
}

Body section of a message template with channel-specific content

func (TemplateBodyParam) MarshalJSON added in v0.30.0

func (r TemplateBodyParam) MarshalJSON() (data []byte, err error)

func (*TemplateBodyParam) UnmarshalJSON added in v0.30.0

func (r *TemplateBodyParam) UnmarshalJSON(data []byte) error

type TemplateButtonParam added in v0.30.0

type TemplateButtonParam struct {
	// Properties specific to the button type
	Props TemplateButtonPropsParam `json:"props,omitzero" api:"required"`
	// The type of button (e.g., QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, COPY_CODE)
	Type string `json:"type" api:"required"`
	// The unique identifier of the button (1-based index)
	ID param.Opt[int64] `json:"id,omitzero"`
	// contains filtered or unexported fields
}

Interactive button in a message template

The properties Props, Type are required.

func (TemplateButtonParam) MarshalJSON added in v0.30.0

func (r TemplateButtonParam) MarshalJSON() (data []byte, err error)

func (*TemplateButtonParam) UnmarshalJSON added in v0.30.0

func (r *TemplateButtonParam) UnmarshalJSON(data []byte) error

type TemplateButtonPropsParam added in v0.30.0

type TemplateButtonPropsParam struct {
	ActiveFor      int64  `json:"activeFor" api:"required"`
	CountryCode    string `json:"countryCode" api:"required"`
	OfferCode      string `json:"offerCode" api:"required"`
	PhoneNumber    string `json:"phoneNumber" api:"required"`
	QuickReplyType string `json:"quickReplyType" api:"required"`
	Text           string `json:"text" api:"required"`
	URL            string `json:"url" api:"required"`
	URLType        string `json:"urlType" api:"required"`
	// Variables embedded in a dynamic URL button (only when UrlType = dynamic). Count
	// is capped by TemplateContentLimits.MaxUrlButtonVariables; the placeholder must
	// appear at the end of Url (validated in TemplateDefinitionValidator).
	Variables     []TemplateVariableParam `json:"variables,omitzero" api:"required"`
	AutofillText  param.Opt[string]       `json:"autofillText,omitzero"`
	OtpType       param.Opt[string]       `json:"otpType,omitzero"`
	PackageName   param.Opt[string]       `json:"packageName,omitzero"`
	SignatureHash param.Opt[string]       `json:"signatureHash,omitzero"`
	// contains filtered or unexported fields
}

The properties ActiveFor, CountryCode, OfferCode, PhoneNumber, QuickReplyType, Text, URL, URLType, Variables are required.

func (TemplateButtonPropsParam) MarshalJSON added in v0.30.0

func (r TemplateButtonPropsParam) MarshalJSON() (data []byte, err error)

func (*TemplateButtonPropsParam) UnmarshalJSON added in v0.30.0

func (r *TemplateButtonPropsParam) UnmarshalJSON(data []byte) error

type TemplateDefinitionParam

type TemplateDefinitionParam struct {
	// Body section of a message template with channel-specific content
	Body TemplateBodyParam `json:"body,omitzero" api:"required"`
	// The version of the template definition format
	DefinitionVersion param.Opt[string] `json:"definitionVersion,omitzero"`
	// Optional list of interactive buttons (e.g., quick replies, URLs, phone numbers)
	Buttons []TemplateButtonParam `json:"buttons,omitzero"`
	// Configuration for AUTHENTICATION category templates
	AuthenticationConfig AuthenticationConfigParam `json:"authenticationConfig,omitzero"`
	// Footer section of a message template
	Footer TemplateFooterParam `json:"footer,omitzero"`
	// Header section of a message template
	Header TemplateHeaderParam `json:"header,omitzero"`
	// contains filtered or unexported fields
}

Complete definition of a message template including header, body, footer, and buttons

The property Body is required.

func (TemplateDefinitionParam) MarshalJSON

func (r TemplateDefinitionParam) MarshalJSON() (data []byte, err error)

func (*TemplateDefinitionParam) UnmarshalJSON

func (r *TemplateDefinitionParam) UnmarshalJSON(data []byte) error

type TemplateDeleteParams added in v0.7.0

type TemplateDeleteParams struct {
	// Whether to also delete the template from WhatsApp/Meta (optional, defaults to
	// false)
	DeleteFromMeta param.Opt[bool] `json:"delete_from_meta,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox    param.Opt[bool]   `json:"sandbox,omitzero"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (TemplateDeleteParams) MarshalJSON added in v0.7.0

func (r TemplateDeleteParams) MarshalJSON() (data []byte, err error)

func (*TemplateDeleteParams) UnmarshalJSON added in v0.7.0

func (r *TemplateDeleteParams) UnmarshalJSON(data []byte) error

type TemplateEvent added in v0.31.0

type TemplateEvent struct {
	// The specific event within the family, for example message.delivered or
	// message.received. Absent on events that have no subtype, so treat it as
	// optional.
	Event string `json:"event" api:"nullable"`
	// The event family, for example message or templates. Route on this first, then on
	// event for the specific change.
	Field string `json:"field"`
	// Body of a template status event. Delivered when a template's review outcome
	// changes, so you can react without polling.
	Payload TemplateEventPayload `json:"payload" api:"nullable"`
	// When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
	// time, not the time the underlying change happened. Use the timestamp inside the
	// payload for the latter.
	Timestamp string `json:"timestamp"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Event       respjson.Field
		Field       respjson.Field
		Payload     respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and varies only in Payload.

func (TemplateEvent) RawJSON added in v0.31.0

func (r TemplateEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateEvent) UnmarshalJSON added in v0.31.0

func (r *TemplateEvent) UnmarshalJSON(data []byte) error

type TemplateEventPayload added in v0.31.0

type TemplateEventPayload struct {
	// The account the template belongs to.
	AccountID string `json:"account_id" format:"uuid"`
	// The template's category, for example UTILITY, MARKETING, or AUTHENTICATION.
	Category string `json:"category"`
	// The channel the template applies to.
	Channel string `json:"channel"`
	// The template's language code, for example en_US.
	Language string `json:"language"`
	// Why the template reached Status, when a reason was given. Populated on a
	// rejection.
	Reason string `json:"reason" api:"nullable"`
	// The review status the template just reached, for example APPROVED or REJECTED.
	Status string `json:"status"`
	// The template in Sent.
	TemplateID string `json:"template_id" format:"uuid"`
	// The template's display name.
	TemplateName string `json:"template_name"`
	// The template's identifier with Meta, assigned when the template is submitted for
	// review.
	WhatsappTemplateID string `json:"whatsapp_template_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountID          respjson.Field
		Category           respjson.Field
		Channel            respjson.Field
		Language           respjson.Field
		Reason             respjson.Field
		Status             respjson.Field
		TemplateID         respjson.Field
		TemplateName       respjson.Field
		WhatsappTemplateID respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Body of a template status event. Delivered when a template's review outcome changes, so you can react without polling.

func (TemplateEventPayload) RawJSON added in v0.31.0

func (r TemplateEventPayload) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateEventPayload) UnmarshalJSON added in v0.31.0

func (r *TemplateEventPayload) UnmarshalJSON(data []byte) error

type TemplateFooterParam added in v0.30.0

type TemplateFooterParam struct {
	// The footer template text with optional variable placeholders
	Template string `json:"template" api:"required"`
	// The type of footer (typically "text")
	Type param.Opt[string] `json:"type,omitzero"`
	// List of variables used in the footer template
	Variables []TemplateVariableParam `json:"variables,omitzero"`
	// contains filtered or unexported fields
}

Footer section of a message template

The property Template is required.

func (TemplateFooterParam) MarshalJSON added in v0.30.0

func (r TemplateFooterParam) MarshalJSON() (data []byte, err error)

func (*TemplateFooterParam) UnmarshalJSON added in v0.30.0

func (r *TemplateFooterParam) UnmarshalJSON(data []byte) error

type TemplateGetParams added in v0.8.0

type TemplateGetParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type TemplateGetResponse added in v0.23.0

type TemplateGetResponse struct {
	// Template response for v3 API
	Data TemplateGetResponseData `json:"data" api:"nullable"`
	// Error information
	Error TemplateGetResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta TemplateGetResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (TemplateGetResponse) RawJSON added in v0.23.0

func (r TemplateGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateGetResponse) UnmarshalJSON added in v0.23.0

func (r *TemplateGetResponse) UnmarshalJSON(data []byte) error

type TemplateGetResponseData added in v0.23.0

type TemplateGetResponseData struct {
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" api:"required" format:"uuid"`
	// Unique template identifier
	ID string `json:"id" format:"uuid"`
	// Template category: MARKETING, UTILITY, AUTHENTICATION
	Category string `json:"category"`
	// Supported channels: sms, whatsapp
	Channels []string `json:"channels" api:"nullable"`
	// When the template was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Whether the template is published and active
	IsPublished bool `json:"is_published"`
	// Template language code (e.g., en_US)
	Language string `json:"language"`
	// Template display name
	Name string `json:"name"`
	// Template status: APPROVED, PENDING, REJECTED
	Status string `json:"status"`
	// When the template was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// Template variables for personalization
	Variables []string `json:"variables" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomerID  respjson.Field
		ID          respjson.Field
		Category    respjson.Field
		Channels    respjson.Field
		CreatedAt   respjson.Field
		IsPublished respjson.Field
		Language    respjson.Field
		Name        respjson.Field
		Status      respjson.Field
		UpdatedAt   respjson.Field
		Variables   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Template response for v3 API

func (TemplateGetResponseData) RawJSON added in v0.23.0

func (r TemplateGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateGetResponseData) UnmarshalJSON added in v0.23.0

func (r *TemplateGetResponseData) UnmarshalJSON(data []byte) error

type TemplateGetResponseError added in v0.23.0

type TemplateGetResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (TemplateGetResponseError) RawJSON added in v0.23.0

func (r TemplateGetResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateGetResponseError) UnmarshalJSON added in v0.23.0

func (r *TemplateGetResponseError) UnmarshalJSON(data []byte) error

type TemplateGetResponseMeta added in v0.23.0

type TemplateGetResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (TemplateGetResponseMeta) RawJSON added in v0.23.0

func (r TemplateGetResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateGetResponseMeta) UnmarshalJSON added in v0.23.0

func (r *TemplateGetResponseMeta) UnmarshalJSON(data []byte) error

type TemplateHeaderParam added in v0.30.0

type TemplateHeaderParam struct {
	// The header template text with optional variable placeholders (e.g., "Welcome to
	// {{0:variable}}")
	Template string `json:"template" api:"required"`
	// The type of header (e.g., "text", "image", "video", "document")
	Type param.Opt[string] `json:"type,omitzero"`
	// List of variables used in the header template
	Variables []TemplateVariableParam `json:"variables,omitzero"`
	// contains filtered or unexported fields
}

Header section of a message template

The property Template is required.

func (TemplateHeaderParam) MarshalJSON added in v0.30.0

func (r TemplateHeaderParam) MarshalJSON() (data []byte, err error)

func (*TemplateHeaderParam) UnmarshalJSON added in v0.30.0

func (r *TemplateHeaderParam) UnmarshalJSON(data []byte) error

type TemplateListParams

type TemplateListParams struct {
	// Page number (1-indexed)
	Page int64 `query:"page" api:"required" json:"-"`
	// Number of items per page
	PageSize int64 `query:"page_size" api:"required" json:"-"`
	// Optional category filter: MARKETING, UTILITY, AUTHENTICATION
	Category param.Opt[string] `query:"category,omitzero" json:"-"`
	// Accepted and ignored. It used to filter on the welcome-playground marker inside
	// a template's LOB details; that filter is gone and nothing reads this value, so
	// sending it neither narrows nor widens the result. Retained only so a client
	// still passing is_welcome_playground keeps binding instead of the request shape
	// changing under it.
	IsWelcomePlayground param.Opt[bool] `query:"is_welcome_playground,omitzero" json:"-"`
	// Optional search term for filtering templates
	Search param.Opt[string] `query:"search,omitzero" json:"-"`
	// Optional status filter: APPROVED, PENDING, REJECTED
	Status     param.Opt[string] `query:"status,omitzero" json:"-"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (TemplateListParams) URLQuery

func (r TemplateListParams) URLQuery() (v url.Values, err error)

URLQuery serializes TemplateListParams's query parameters as `url.Values`.

type TemplateListResponse

type TemplateListResponse struct {
	// A paginated list of templates.
	Data TemplateListResponseData `json:"data" api:"nullable"`
	// Error information
	Error TemplateListResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta TemplateListResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (TemplateListResponse) RawJSON

func (r TemplateListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateListResponse) UnmarshalJSON

func (r *TemplateListResponse) UnmarshalJSON(data []byte) error

type TemplateListResponseData added in v0.7.0

type TemplateListResponseData struct {
	// Pagination metadata for list responses
	Pagination TemplateListResponseDataPagination `json:"pagination"`
	// The templates on this page.
	Templates []TemplateListResponseDataTemplate `json:"templates"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Pagination  respjson.Field
		Templates   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A paginated list of templates.

func (TemplateListResponseData) RawJSON added in v0.7.0

func (r TemplateListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateListResponseData) UnmarshalJSON added in v0.7.0

func (r *TemplateListResponseData) UnmarshalJSON(data []byte) error

type TemplateListResponseDataPagination added in v0.23.0

type TemplateListResponseDataPagination struct {
	// Cursor-based pagination. Never populated — see Cursors.
	//
	// Deprecated: deprecated
	Cursors TemplateListResponseDataPaginationCursors `json:"cursors" api:"nullable"`
	// Whether there are more pages after this one
	HasMore bool `json:"has_more"`
	// Current page number (1-indexed)
	Page int64 `json:"page"`
	// Number of items per page
	PageSize int64 `json:"page_size"`
	// Total number of items across all pages
	TotalCount int64 `json:"total_count"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cursors     respjson.Field
		HasMore     respjson.Field
		Page        respjson.Field
		PageSize    respjson.Field
		TotalCount  respjson.Field
		TotalPages  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata for list responses

func (TemplateListResponseDataPagination) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*TemplateListResponseDataPagination) UnmarshalJSON added in v0.23.0

func (r *TemplateListResponseDataPagination) UnmarshalJSON(data []byte) error

type TemplateListResponseDataPaginationCursors deprecated added in v0.23.0

type TemplateListResponseDataPaginationCursors struct {
	// Cursor to fetch the next page.
	After string `json:"after" api:"nullable"`
	// Cursor to fetch the previous page.
	Before string `json:"before" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cursor-based pagination. Never populated — see Cursors.

Deprecated: deprecated

func (TemplateListResponseDataPaginationCursors) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*TemplateListResponseDataPaginationCursors) UnmarshalJSON added in v0.23.0

func (r *TemplateListResponseDataPaginationCursors) UnmarshalJSON(data []byte) error

type TemplateListResponseDataTemplate added in v0.23.0

type TemplateListResponseDataTemplate struct {
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" api:"required" format:"uuid"`
	// Unique template identifier
	ID string `json:"id" format:"uuid"`
	// Template category: MARKETING, UTILITY, AUTHENTICATION
	Category string `json:"category"`
	// Supported channels: sms, whatsapp
	Channels []string `json:"channels" api:"nullable"`
	// When the template was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Whether the template is published and active
	IsPublished bool `json:"is_published"`
	// Template language code (e.g., en_US)
	Language string `json:"language"`
	// Template display name
	Name string `json:"name"`
	// Template status: APPROVED, PENDING, REJECTED
	Status string `json:"status"`
	// When the template was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// Template variables for personalization
	Variables []string `json:"variables" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomerID  respjson.Field
		ID          respjson.Field
		Category    respjson.Field
		Channels    respjson.Field
		CreatedAt   respjson.Field
		IsPublished respjson.Field
		Language    respjson.Field
		Name        respjson.Field
		Status      respjson.Field
		UpdatedAt   respjson.Field
		Variables   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Template response for v3 API

func (TemplateListResponseDataTemplate) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*TemplateListResponseDataTemplate) UnmarshalJSON added in v0.23.0

func (r *TemplateListResponseDataTemplate) UnmarshalJSON(data []byte) error

type TemplateListResponseError added in v0.23.0

type TemplateListResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (TemplateListResponseError) RawJSON added in v0.23.0

func (r TemplateListResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateListResponseError) UnmarshalJSON added in v0.23.0

func (r *TemplateListResponseError) UnmarshalJSON(data []byte) error

type TemplateListResponseMeta added in v0.23.0

type TemplateListResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (TemplateListResponseMeta) RawJSON added in v0.23.0

func (r TemplateListResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateListResponseMeta) UnmarshalJSON added in v0.23.0

func (r *TemplateListResponseMeta) UnmarshalJSON(data []byte) error

type TemplateNewParams

type TemplateNewParams struct {
	// Template category: MARKETING, UTILITY, AUTHENTICATION (optional, auto-detected
	// if not provided)
	Category param.Opt[string] `json:"category,omitzero"`
	// Source of template creation (default: from-api)
	CreationSource param.Opt[string] `json:"creation_source,omitzero"`
	// Template language code (e.g., en_US) (optional, auto-detected if not provided)
	Language param.Opt[string] `json:"language,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox param.Opt[bool] `json:"sandbox,omitzero"`
	// Whether to submit the template for review after creation (default: false)
	SubmitForReview param.Opt[bool]   `json:"submit_for_review,omitzero"`
	IdempotencyKey  param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID      param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// Complete definition of a message template including header, body, footer, and
	// buttons
	Definition TemplateDefinitionParam `json:"definition,omitzero"`
	// contains filtered or unexported fields
}

func (TemplateNewParams) MarshalJSON

func (r TemplateNewParams) MarshalJSON() (data []byte, err error)

func (*TemplateNewParams) UnmarshalJSON

func (r *TemplateNewParams) UnmarshalJSON(data []byte) error

type TemplateNewResponse added in v0.23.0

type TemplateNewResponse struct {
	// Template response for v3 API
	Data TemplateNewResponseData `json:"data" api:"nullable"`
	// Error information
	Error TemplateNewResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta TemplateNewResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (TemplateNewResponse) RawJSON added in v0.23.0

func (r TemplateNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateNewResponse) UnmarshalJSON added in v0.23.0

func (r *TemplateNewResponse) UnmarshalJSON(data []byte) error

type TemplateNewResponseData added in v0.23.0

type TemplateNewResponseData struct {
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" api:"required" format:"uuid"`
	// Unique template identifier
	ID string `json:"id" format:"uuid"`
	// Template category: MARKETING, UTILITY, AUTHENTICATION
	Category string `json:"category"`
	// Supported channels: sms, whatsapp
	Channels []string `json:"channels" api:"nullable"`
	// When the template was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Whether the template is published and active
	IsPublished bool `json:"is_published"`
	// Template language code (e.g., en_US)
	Language string `json:"language"`
	// Template display name
	Name string `json:"name"`
	// Template status: APPROVED, PENDING, REJECTED
	Status string `json:"status"`
	// When the template was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// Template variables for personalization
	Variables []string `json:"variables" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomerID  respjson.Field
		ID          respjson.Field
		Category    respjson.Field
		Channels    respjson.Field
		CreatedAt   respjson.Field
		IsPublished respjson.Field
		Language    respjson.Field
		Name        respjson.Field
		Status      respjson.Field
		UpdatedAt   respjson.Field
		Variables   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Template response for v3 API

func (TemplateNewResponseData) RawJSON added in v0.23.0

func (r TemplateNewResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateNewResponseData) UnmarshalJSON added in v0.23.0

func (r *TemplateNewResponseData) UnmarshalJSON(data []byte) error

type TemplateNewResponseError added in v0.23.0

type TemplateNewResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (TemplateNewResponseError) RawJSON added in v0.23.0

func (r TemplateNewResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateNewResponseError) UnmarshalJSON added in v0.23.0

func (r *TemplateNewResponseError) UnmarshalJSON(data []byte) error

type TemplateNewResponseMeta added in v0.23.0

type TemplateNewResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (TemplateNewResponseMeta) RawJSON added in v0.23.0

func (r TemplateNewResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateNewResponseMeta) UnmarshalJSON added in v0.23.0

func (r *TemplateNewResponseMeta) UnmarshalJSON(data []byte) error

type TemplateService

type TemplateService struct {
	Options []option.RequestOption
}

Reusable message bodies with named variables.

A template is substituted at send time from the values you pass, so the copy lives here rather than in your application. WhatsApp templates additionally need Meta's approval before they can be sent, and a template's channel status reports where that stands — an approved SMS template and an unapproved WhatsApp one are the same template in two states.

TemplateService contains methods and other services that help with interacting with the Sent API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTemplateService method instead.

func NewTemplateService

func NewTemplateService(opts ...option.RequestOption) (r TemplateService)

NewTemplateService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*TemplateService) Delete

func (r *TemplateService) Delete(ctx context.Context, id string, params TemplateDeleteParams, opts ...option.RequestOption) (err error)

Deletes a template by ID. Optionally, you can also delete the template from WhatsApp/Meta by setting delete_from_meta=true.

func (*TemplateService) Get

Retrieves a specific template by its ID. Returns template details including name, category, language, status, and definition.

func (*TemplateService) List

Retrieves a paginated list of message templates for the authenticated customer. Supports filtering by status, category, and search term.

func (*TemplateService) New

Creates a new message template with header, body, footer, and buttons. The template can be submitted for review immediately or saved as draft for later submission.

func (*TemplateService) Update added in v0.7.0

Updates an existing template's name, category, language, definition, or submits it for review.

type TemplateUpdateParams added in v0.7.0

type TemplateUpdateParams struct {
	// Template category: MARKETING, UTILITY, AUTHENTICATION
	Category param.Opt[string] `json:"category,omitzero"`
	// Template language code (e.g., en_US)
	Language param.Opt[string] `json:"language,omitzero"`
	// Template display name
	Name param.Opt[string] `json:"name,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox param.Opt[bool] `json:"sandbox,omitzero"`
	// Whether to submit the template for review after updating (default: false)
	SubmitForReview param.Opt[bool]   `json:"submit_for_review,omitzero"`
	IdempotencyKey  param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID      param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// Complete definition of a message template including header, body, footer, and
	// buttons
	Definition TemplateDefinitionParam `json:"definition,omitzero"`
	// contains filtered or unexported fields
}

func (TemplateUpdateParams) MarshalJSON added in v0.7.0

func (r TemplateUpdateParams) MarshalJSON() (data []byte, err error)

func (*TemplateUpdateParams) UnmarshalJSON added in v0.7.0

func (r *TemplateUpdateParams) UnmarshalJSON(data []byte) error

type TemplateUpdateResponse added in v0.23.0

type TemplateUpdateResponse struct {
	// Template response for v3 API
	Data TemplateUpdateResponseData `json:"data" api:"nullable"`
	// Error information
	Error TemplateUpdateResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta TemplateUpdateResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (TemplateUpdateResponse) RawJSON added in v0.23.0

func (r TemplateUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateUpdateResponse) UnmarshalJSON added in v0.23.0

func (r *TemplateUpdateResponse) UnmarshalJSON(data []byte) error

type TemplateUpdateResponseData added in v0.23.0

type TemplateUpdateResponseData struct {
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" api:"required" format:"uuid"`
	// Unique template identifier
	ID string `json:"id" format:"uuid"`
	// Template category: MARKETING, UTILITY, AUTHENTICATION
	Category string `json:"category"`
	// Supported channels: sms, whatsapp
	Channels []string `json:"channels" api:"nullable"`
	// When the template was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Whether the template is published and active
	IsPublished bool `json:"is_published"`
	// Template language code (e.g., en_US)
	Language string `json:"language"`
	// Template display name
	Name string `json:"name"`
	// Template status: APPROVED, PENDING, REJECTED
	Status string `json:"status"`
	// When the template was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// Template variables for personalization
	Variables []string `json:"variables" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomerID  respjson.Field
		ID          respjson.Field
		Category    respjson.Field
		Channels    respjson.Field
		CreatedAt   respjson.Field
		IsPublished respjson.Field
		Language    respjson.Field
		Name        respjson.Field
		Status      respjson.Field
		UpdatedAt   respjson.Field
		Variables   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Template response for v3 API

func (TemplateUpdateResponseData) RawJSON added in v0.23.0

func (r TemplateUpdateResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateUpdateResponseData) UnmarshalJSON added in v0.23.0

func (r *TemplateUpdateResponseData) UnmarshalJSON(data []byte) error

type TemplateUpdateResponseError added in v0.23.0

type TemplateUpdateResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (TemplateUpdateResponseError) RawJSON added in v0.23.0

func (r TemplateUpdateResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateUpdateResponseError) UnmarshalJSON added in v0.23.0

func (r *TemplateUpdateResponseError) UnmarshalJSON(data []byte) error

type TemplateUpdateResponseMeta added in v0.23.0

type TemplateUpdateResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (TemplateUpdateResponseMeta) RawJSON added in v0.23.0

func (r TemplateUpdateResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*TemplateUpdateResponseMeta) UnmarshalJSON added in v0.23.0

func (r *TemplateUpdateResponseMeta) UnmarshalJSON(data []byte) error

type TemplateVariableParam

type TemplateVariableParam struct {
	Name  string                     `json:"name" api:"required"`
	Props TemplateVariablePropsParam `json:"props,omitzero" api:"required"`
	Type  string                     `json:"type" api:"required"`
	ID    param.Opt[int64]           `json:"id,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Props, Type are required.

func (TemplateVariableParam) MarshalJSON

func (r TemplateVariableParam) MarshalJSON() (data []byte, err error)

func (*TemplateVariableParam) UnmarshalJSON

func (r *TemplateVariableParam) UnmarshalJSON(data []byte) error

type TemplateVariablePropsParam

type TemplateVariablePropsParam struct {
	MediaType    string            `json:"mediaType" api:"required"`
	Sample       string            `json:"sample" api:"required"`
	URL          string            `json:"url" api:"required"`
	VariableType string            `json:"variableType" api:"required"`
	Alt          param.Opt[string] `json:"alt,omitzero"`
	Regex        param.Opt[string] `json:"regex,omitzero"`
	ShortURL     param.Opt[string] `json:"shortUrl,omitzero"`
	// contains filtered or unexported fields
}

The properties MediaType, Sample, URL, VariableType are required.

func (TemplateVariablePropsParam) MarshalJSON

func (r TemplateVariablePropsParam) MarshalJSON() (data []byte, err error)

func (*TemplateVariablePropsParam) UnmarshalJSON

func (r *TemplateVariablePropsParam) UnmarshalJSON(data []byte) error

type UserGetParams added in v0.8.0

type UserGetParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type UserGetResponse added in v0.23.0

type UserGetResponse struct {
	// User response for v3 API
	Data UserGetResponseData `json:"data" api:"nullable"`
	// Error information
	Error UserGetResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta UserGetResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (UserGetResponse) RawJSON added in v0.23.0

func (r UserGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserGetResponse) UnmarshalJSON added in v0.23.0

func (r *UserGetResponse) UnmarshalJSON(data []byte) error

type UserGetResponseData added in v0.23.0

type UserGetResponseData struct {
	// User unique identifier
	ID string `json:"id" format:"uuid"`
	// When the user was added to the organization
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" format:"uuid"`
	// User email address
	Email string `json:"email"`
	// When the user was invited
	InvitedAt time.Time `json:"invited_at" api:"nullable" format:"date-time"`
	// When the user last logged in
	LastLoginAt time.Time `json:"last_login_at" api:"nullable" format:"date-time"`
	// User full name
	Name string `json:"name"`
	// User role in the organization: admin, billing, developer
	Role string `json:"role"`
	// User status: active, invited, suspended, rejected
	Status string `json:"status"`
	// When the user record was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		CustomerID  respjson.Field
		Email       respjson.Field
		InvitedAt   respjson.Field
		LastLoginAt respjson.Field
		Name        respjson.Field
		Role        respjson.Field
		Status      respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

User response for v3 API

func (UserGetResponseData) RawJSON added in v0.23.0

func (r UserGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserGetResponseData) UnmarshalJSON added in v0.23.0

func (r *UserGetResponseData) UnmarshalJSON(data []byte) error

type UserGetResponseError added in v0.23.0

type UserGetResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (UserGetResponseError) RawJSON added in v0.23.0

func (r UserGetResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserGetResponseError) UnmarshalJSON added in v0.23.0

func (r *UserGetResponseError) UnmarshalJSON(data []byte) error

type UserGetResponseMeta added in v0.23.0

type UserGetResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (UserGetResponseMeta) RawJSON added in v0.23.0

func (r UserGetResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserGetResponseMeta) UnmarshalJSON added in v0.23.0

func (r *UserGetResponseMeta) UnmarshalJSON(data []byte) error

type UserInviteParams added in v0.7.0

type UserInviteParams struct {
	// User email address (required)
	Email param.Opt[string] `json:"email,omitzero" format:"email"`
	// User full name (required)
	Name param.Opt[string] `json:"name,omitzero"`
	// User role: admin, billing, or developer (required)
	Role param.Opt[string] `json:"role,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (UserInviteParams) MarshalJSON added in v0.7.0

func (r UserInviteParams) MarshalJSON() (data []byte, err error)

func (*UserInviteParams) UnmarshalJSON added in v0.7.0

func (r *UserInviteParams) UnmarshalJSON(data []byte) error

type UserInviteResponse added in v0.23.0

type UserInviteResponse struct {
	// User response for v3 API
	Data UserInviteResponseData `json:"data" api:"nullable"`
	// Error information
	Error UserInviteResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta UserInviteResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (UserInviteResponse) RawJSON added in v0.23.0

func (r UserInviteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserInviteResponse) UnmarshalJSON added in v0.23.0

func (r *UserInviteResponse) UnmarshalJSON(data []byte) error

type UserInviteResponseData added in v0.23.0

type UserInviteResponseData struct {
	// User unique identifier
	ID string `json:"id" format:"uuid"`
	// When the user was added to the organization
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" format:"uuid"`
	// User email address
	Email string `json:"email"`
	// When the user was invited
	InvitedAt time.Time `json:"invited_at" api:"nullable" format:"date-time"`
	// When the user last logged in
	LastLoginAt time.Time `json:"last_login_at" api:"nullable" format:"date-time"`
	// User full name
	Name string `json:"name"`
	// User role in the organization: admin, billing, developer
	Role string `json:"role"`
	// User status: active, invited, suspended, rejected
	Status string `json:"status"`
	// When the user record was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		CustomerID  respjson.Field
		Email       respjson.Field
		InvitedAt   respjson.Field
		LastLoginAt respjson.Field
		Name        respjson.Field
		Role        respjson.Field
		Status      respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

User response for v3 API

func (UserInviteResponseData) RawJSON added in v0.23.0

func (r UserInviteResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserInviteResponseData) UnmarshalJSON added in v0.23.0

func (r *UserInviteResponseData) UnmarshalJSON(data []byte) error

type UserInviteResponseError added in v0.23.0

type UserInviteResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (UserInviteResponseError) RawJSON added in v0.23.0

func (r UserInviteResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserInviteResponseError) UnmarshalJSON added in v0.23.0

func (r *UserInviteResponseError) UnmarshalJSON(data []byte) error

type UserInviteResponseMeta added in v0.23.0

type UserInviteResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (UserInviteResponseMeta) RawJSON added in v0.23.0

func (r UserInviteResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserInviteResponseMeta) UnmarshalJSON added in v0.23.0

func (r *UserInviteResponseMeta) UnmarshalJSON(data []byte) error

type UserListParams added in v0.8.0

type UserListParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type UserListResponse added in v0.7.0

type UserListResponse struct {
	// The users in the organization.
	Data UserListResponseData `json:"data" api:"nullable"`
	// Error information
	Error UserListResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta UserListResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (UserListResponse) RawJSON added in v0.7.0

func (r UserListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserListResponse) UnmarshalJSON added in v0.7.0

func (r *UserListResponse) UnmarshalJSON(data []byte) error

type UserListResponseData added in v0.7.0

type UserListResponseData struct {
	// Pagination metadata for list responses
	Pagination UserListResponseDataPagination `json:"pagination"`
	// The users on this page.
	Users []UserListResponseDataUser `json:"users"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Pagination  respjson.Field
		Users       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The users in the organization.

func (UserListResponseData) RawJSON added in v0.7.0

func (r UserListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserListResponseData) UnmarshalJSON added in v0.7.0

func (r *UserListResponseData) UnmarshalJSON(data []byte) error

type UserListResponseDataPagination added in v0.32.0

type UserListResponseDataPagination struct {
	// Cursor-based pagination. Never populated — see Cursors.
	//
	// Deprecated: deprecated
	Cursors UserListResponseDataPaginationCursors `json:"cursors" api:"nullable"`
	// Whether there are more pages after this one
	HasMore bool `json:"has_more"`
	// Current page number (1-indexed)
	Page int64 `json:"page"`
	// Number of items per page
	PageSize int64 `json:"page_size"`
	// Total number of items across all pages
	TotalCount int64 `json:"total_count"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cursors     respjson.Field
		HasMore     respjson.Field
		Page        respjson.Field
		PageSize    respjson.Field
		TotalCount  respjson.Field
		TotalPages  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata for list responses

func (UserListResponseDataPagination) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*UserListResponseDataPagination) UnmarshalJSON added in v0.32.0

func (r *UserListResponseDataPagination) UnmarshalJSON(data []byte) error

type UserListResponseDataPaginationCursors deprecated added in v0.32.0

type UserListResponseDataPaginationCursors struct {
	// Cursor to fetch the next page.
	After string `json:"after" api:"nullable"`
	// Cursor to fetch the previous page.
	Before string `json:"before" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cursor-based pagination. Never populated — see Cursors.

Deprecated: deprecated

func (UserListResponseDataPaginationCursors) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*UserListResponseDataPaginationCursors) UnmarshalJSON added in v0.32.0

func (r *UserListResponseDataPaginationCursors) UnmarshalJSON(data []byte) error

type UserListResponseDataUser added in v0.23.0

type UserListResponseDataUser struct {
	// User unique identifier
	ID string `json:"id" format:"uuid"`
	// When the user was added to the organization
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" format:"uuid"`
	// User email address
	Email string `json:"email"`
	// When the user was invited
	InvitedAt time.Time `json:"invited_at" api:"nullable" format:"date-time"`
	// When the user last logged in
	LastLoginAt time.Time `json:"last_login_at" api:"nullable" format:"date-time"`
	// User full name
	Name string `json:"name"`
	// User role in the organization: admin, billing, developer
	Role string `json:"role"`
	// User status: active, invited, suspended, rejected
	Status string `json:"status"`
	// When the user record was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		CustomerID  respjson.Field
		Email       respjson.Field
		InvitedAt   respjson.Field
		LastLoginAt respjson.Field
		Name        respjson.Field
		Role        respjson.Field
		Status      respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

User response for v3 API

func (UserListResponseDataUser) RawJSON added in v0.23.0

func (r UserListResponseDataUser) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserListResponseDataUser) UnmarshalJSON added in v0.23.0

func (r *UserListResponseDataUser) UnmarshalJSON(data []byte) error

type UserListResponseError added in v0.23.0

type UserListResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (UserListResponseError) RawJSON added in v0.23.0

func (r UserListResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserListResponseError) UnmarshalJSON added in v0.23.0

func (r *UserListResponseError) UnmarshalJSON(data []byte) error

type UserListResponseMeta added in v0.23.0

type UserListResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (UserListResponseMeta) RawJSON added in v0.23.0

func (r UserListResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserListResponseMeta) UnmarshalJSON added in v0.23.0

func (r *UserListResponseMeta) UnmarshalJSON(data []byte) error

type UserRemoveParams added in v0.7.0

type UserRemoveParams struct {
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox    param.Opt[bool]   `json:"sandbox,omitzero"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (UserRemoveParams) MarshalJSON added in v0.7.0

func (r UserRemoveParams) MarshalJSON() (data []byte, err error)

func (*UserRemoveParams) UnmarshalJSON added in v0.7.0

func (r *UserRemoveParams) UnmarshalJSON(data []byte) error

type UserService added in v0.7.0

type UserService struct {
	Options []option.RequestOption
}

The people who can sign in to your organization, and what each may do.

Users are dashboard access and nothing else — they do not send, and removing one does not affect traffic. An API key is not a user: it belongs to the organization or to a sender profile, so revoking a person's access leaves your integration running.

UserService contains methods and other services that help with interacting with the Sent API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserService method instead.

func NewUserService added in v0.7.0

func NewUserService(opts ...option.RequestOption) (r UserService)

NewUserService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserService) Get added in v0.7.0

func (r *UserService) Get(ctx context.Context, userID string, query UserGetParams, opts ...option.RequestOption) (res *UserGetResponse, err error)

Retrieves detailed information about a specific user in an organization or profile. Requires developer role or higher.

func (*UserService) Invite added in v0.7.0

func (r *UserService) Invite(ctx context.Context, params UserInviteParams, opts ...option.RequestOption) (res *UserInviteResponse, err error)

Sends an invitation to a user to join the organization or profile with a specific role. Requires admin role. The user will receive an invitation email with a token to accept. Invitation tokens expire after 7 days.

func (*UserService) List added in v0.7.0

func (r *UserService) List(ctx context.Context, query UserListParams, opts ...option.RequestOption) (res *UserListResponse, err error)

Retrieves all users who have access to the organization or profile identified by the API key, including their roles and status. Shows invited users (pending acceptance) and active users. Requires developer role or higher.

func (*UserService) Remove added in v0.7.0

func (r *UserService) Remove(ctx context.Context, userID string, params UserRemoveParams, opts ...option.RequestOption) (err error)

Removes a user's access to an organization or profile. Requires admin role. You cannot remove yourself or remove the last admin.

func (*UserService) UpdateRole added in v0.7.0

func (r *UserService) UpdateRole(ctx context.Context, userID string, params UserUpdateRoleParams, opts ...option.RequestOption) (res *UserUpdateRoleResponse, err error)

Updates a user's role in the organization or profile. Requires admin role. You cannot change your own role or demote the last admin.

type UserUpdateRoleParams added in v0.7.0

type UserUpdateRoleParams struct {
	// User role: admin, billing, or developer (required)
	Role param.Opt[string] `json:"role,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (UserUpdateRoleParams) MarshalJSON added in v0.7.0

func (r UserUpdateRoleParams) MarshalJSON() (data []byte, err error)

func (*UserUpdateRoleParams) UnmarshalJSON added in v0.7.0

func (r *UserUpdateRoleParams) UnmarshalJSON(data []byte) error

type UserUpdateRoleResponse added in v0.23.0

type UserUpdateRoleResponse struct {
	// User response for v3 API
	Data UserUpdateRoleResponseData `json:"data" api:"nullable"`
	// Error information
	Error UserUpdateRoleResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta UserUpdateRoleResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (UserUpdateRoleResponse) RawJSON added in v0.23.0

func (r UserUpdateRoleResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserUpdateRoleResponse) UnmarshalJSON added in v0.23.0

func (r *UserUpdateRoleResponse) UnmarshalJSON(data []byte) error

type UserUpdateRoleResponseData added in v0.23.0

type UserUpdateRoleResponseData struct {
	// User unique identifier
	ID string `json:"id" format:"uuid"`
	// When the user was added to the organization
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID string `json:"customer_id" format:"uuid"`
	// User email address
	Email string `json:"email"`
	// When the user was invited
	InvitedAt time.Time `json:"invited_at" api:"nullable" format:"date-time"`
	// When the user last logged in
	LastLoginAt time.Time `json:"last_login_at" api:"nullable" format:"date-time"`
	// User full name
	Name string `json:"name"`
	// User role in the organization: admin, billing, developer
	Role string `json:"role"`
	// User status: active, invited, suspended, rejected
	Status string `json:"status"`
	// When the user record was last updated
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		CustomerID  respjson.Field
		Email       respjson.Field
		InvitedAt   respjson.Field
		LastLoginAt respjson.Field
		Name        respjson.Field
		Role        respjson.Field
		Status      respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

User response for v3 API

func (UserUpdateRoleResponseData) RawJSON added in v0.23.0

func (r UserUpdateRoleResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserUpdateRoleResponseData) UnmarshalJSON added in v0.23.0

func (r *UserUpdateRoleResponseData) UnmarshalJSON(data []byte) error

type UserUpdateRoleResponseError added in v0.23.0

type UserUpdateRoleResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (UserUpdateRoleResponseError) RawJSON added in v0.23.0

func (r UserUpdateRoleResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserUpdateRoleResponseError) UnmarshalJSON added in v0.23.0

func (r *UserUpdateRoleResponseError) UnmarshalJSON(data []byte) error

type UserUpdateRoleResponseMeta added in v0.23.0

type UserUpdateRoleResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (UserUpdateRoleResponseMeta) RawJSON added in v0.23.0

func (r UserUpdateRoleResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserUpdateRoleResponseMeta) UnmarshalJSON added in v0.23.0

func (r *UserUpdateRoleResponseMeta) UnmarshalJSON(data []byte) error

type WebhookDeleteParams added in v0.8.0

type WebhookDeleteParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type WebhookGetParams added in v0.8.0

type WebhookGetParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type WebhookGetResponse added in v0.23.0

type WebhookGetResponse struct {
	// The response data (null if error)
	Data WebhookGetResponseData `json:"data" api:"nullable"`
	// Error information
	Error WebhookGetResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta WebhookGetResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (WebhookGetResponse) RawJSON added in v0.23.0

func (r WebhookGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookGetResponse) UnmarshalJSON added in v0.23.0

func (r *WebhookGetResponse) UnmarshalJSON(data []byte) error

type WebhookGetResponseData added in v0.23.0

type WebhookGetResponseData struct {
	ID                  string    `json:"id" format:"uuid"`
	ConsecutiveFailures int64     `json:"consecutive_failures"`
	CreatedAt           time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID               string              `json:"customer_id" format:"uuid"`
	DisplayName              string              `json:"display_name"`
	EndpointURL              string              `json:"endpoint_url"`
	EventFilters             map[string][]string `json:"event_filters" api:"nullable"`
	EventTypes               []string            `json:"event_types"`
	IsActive                 bool                `json:"is_active"`
	LastDeliveryAttemptAt    time.Time           `json:"last_delivery_attempt_at" api:"nullable" format:"date-time"`
	LastSuccessfulDeliveryAt time.Time           `json:"last_successful_delivery_at" api:"nullable" format:"date-time"`
	RetryCount               int64               `json:"retry_count"`
	SigningSecret            string              `json:"signing_secret" api:"nullable"`
	TimeoutSeconds           int64               `json:"timeout_seconds"`
	UpdatedAt                time.Time           `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		ConsecutiveFailures      respjson.Field
		CreatedAt                respjson.Field
		CustomerID               respjson.Field
		DisplayName              respjson.Field
		EndpointURL              respjson.Field
		EventFilters             respjson.Field
		EventTypes               respjson.Field
		IsActive                 respjson.Field
		LastDeliveryAttemptAt    respjson.Field
		LastSuccessfulDeliveryAt respjson.Field
		RetryCount               respjson.Field
		SigningSecret            respjson.Field
		TimeoutSeconds           respjson.Field
		UpdatedAt                respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The response data (null if error)

func (WebhookGetResponseData) RawJSON added in v0.23.0

func (r WebhookGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookGetResponseData) UnmarshalJSON added in v0.23.0

func (r *WebhookGetResponseData) UnmarshalJSON(data []byte) error

type WebhookGetResponseError added in v0.23.0

type WebhookGetResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (WebhookGetResponseError) RawJSON added in v0.23.0

func (r WebhookGetResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookGetResponseError) UnmarshalJSON added in v0.23.0

func (r *WebhookGetResponseError) UnmarshalJSON(data []byte) error

type WebhookGetResponseMeta added in v0.23.0

type WebhookGetResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (WebhookGetResponseMeta) RawJSON added in v0.23.0

func (r WebhookGetResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookGetResponseMeta) UnmarshalJSON added in v0.23.0

func (r *WebhookGetResponseMeta) UnmarshalJSON(data []byte) error

type WebhookListEventTypesParams added in v0.8.0

type WebhookListEventTypesParams struct {
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type WebhookListEventTypesResponse added in v0.7.0

type WebhookListEventTypesResponse struct {
	// The webhook event types a customer can subscribe to.
	Data WebhookListEventTypesResponseData `json:"data" api:"nullable"`
	// Error information
	Error WebhookListEventTypesResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta WebhookListEventTypesResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (WebhookListEventTypesResponse) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*WebhookListEventTypesResponse) UnmarshalJSON added in v0.7.0

func (r *WebhookListEventTypesResponse) UnmarshalJSON(data []byte) error

type WebhookListEventTypesResponseData added in v0.7.0

type WebhookListEventTypesResponseData struct {
	// The event_types on this page.
	EventTypes []WebhookListEventTypesResponseDataEventType `json:"event_types"`
	// Pagination metadata for list responses
	Pagination WebhookListEventTypesResponseDataPagination `json:"pagination"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EventTypes  respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The webhook event types a customer can subscribe to.

func (WebhookListEventTypesResponseData) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*WebhookListEventTypesResponseData) UnmarshalJSON added in v0.7.0

func (r *WebhookListEventTypesResponseData) UnmarshalJSON(data []byte) error

type WebhookListEventTypesResponseDataEventType added in v0.7.0

type WebhookListEventTypesResponseDataEventType struct {
	Description string `json:"description" api:"nullable"`
	DisplayName string `json:"display_name"`
	EventType   string `json:"event_type" api:"nullable"`
	IsActive    bool   `json:"is_active"`
	Name        string `json:"name"`
	SubTypes    []any  `json:"sub_types" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description respjson.Field
		DisplayName respjson.Field
		EventType   respjson.Field
		IsActive    respjson.Field
		Name        respjson.Field
		SubTypes    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookListEventTypesResponseDataEventType) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*WebhookListEventTypesResponseDataEventType) UnmarshalJSON added in v0.7.0

func (r *WebhookListEventTypesResponseDataEventType) UnmarshalJSON(data []byte) error

type WebhookListEventTypesResponseDataPagination added in v0.32.0

type WebhookListEventTypesResponseDataPagination struct {
	// Cursor-based pagination. Never populated — see Cursors.
	//
	// Deprecated: deprecated
	Cursors WebhookListEventTypesResponseDataPaginationCursors `json:"cursors" api:"nullable"`
	// Whether there are more pages after this one
	HasMore bool `json:"has_more"`
	// Current page number (1-indexed)
	Page int64 `json:"page"`
	// Number of items per page
	PageSize int64 `json:"page_size"`
	// Total number of items across all pages
	TotalCount int64 `json:"total_count"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cursors     respjson.Field
		HasMore     respjson.Field
		Page        respjson.Field
		PageSize    respjson.Field
		TotalCount  respjson.Field
		TotalPages  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata for list responses

func (WebhookListEventTypesResponseDataPagination) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*WebhookListEventTypesResponseDataPagination) UnmarshalJSON added in v0.32.0

func (r *WebhookListEventTypesResponseDataPagination) UnmarshalJSON(data []byte) error

type WebhookListEventTypesResponseDataPaginationCursors deprecated added in v0.32.0

type WebhookListEventTypesResponseDataPaginationCursors struct {
	// Cursor to fetch the next page.
	After string `json:"after" api:"nullable"`
	// Cursor to fetch the previous page.
	Before string `json:"before" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cursor-based pagination. Never populated — see Cursors.

Deprecated: deprecated

func (WebhookListEventTypesResponseDataPaginationCursors) RawJSON added in v0.32.0

Returns the unmodified JSON received from the API

func (*WebhookListEventTypesResponseDataPaginationCursors) UnmarshalJSON added in v0.32.0

type WebhookListEventTypesResponseError added in v0.23.0

type WebhookListEventTypesResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (WebhookListEventTypesResponseError) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookListEventTypesResponseError) UnmarshalJSON added in v0.23.0

func (r *WebhookListEventTypesResponseError) UnmarshalJSON(data []byte) error

type WebhookListEventTypesResponseMeta added in v0.23.0

type WebhookListEventTypesResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (WebhookListEventTypesResponseMeta) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookListEventTypesResponseMeta) UnmarshalJSON added in v0.23.0

func (r *WebhookListEventTypesResponseMeta) UnmarshalJSON(data []byte) error

type WebhookListEventsParams added in v0.7.0

type WebhookListEventsParams struct {
	Page       int64             `query:"page" api:"required" json:"-"`
	PageSize   int64             `query:"page_size" api:"required" json:"-"`
	Search     param.Opt[string] `query:"search,omitzero" json:"-"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (WebhookListEventsParams) URLQuery added in v0.7.0

func (r WebhookListEventsParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebhookListEventsParams's query parameters as `url.Values`.

type WebhookListEventsResponse added in v0.7.0

type WebhookListEventsResponse struct {
	// A paginated list of webhook delivery records.
	Data WebhookListEventsResponseData `json:"data" api:"nullable"`
	// Error information
	Error WebhookListEventsResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta WebhookListEventsResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (WebhookListEventsResponse) RawJSON added in v0.7.0

func (r WebhookListEventsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookListEventsResponse) UnmarshalJSON added in v0.7.0

func (r *WebhookListEventsResponse) UnmarshalJSON(data []byte) error

type WebhookListEventsResponseData added in v0.7.0

type WebhookListEventsResponseData struct {
	// The events on this page.
	Events []WebhookListEventsResponseDataEvent `json:"events"`
	// Pagination metadata for list responses
	Pagination WebhookListEventsResponseDataPagination `json:"pagination"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Events      respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A paginated list of webhook delivery records.

func (WebhookListEventsResponseData) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*WebhookListEventsResponseData) UnmarshalJSON added in v0.7.0

func (r *WebhookListEventsResponseData) UnmarshalJSON(data []byte) error

type WebhookListEventsResponseDataEvent added in v0.7.0

type WebhookListEventsResponseDataEvent struct {
	ID               string    `json:"id" format:"uuid"`
	CreatedAt        time.Time `json:"created_at" format:"date-time"`
	DeliveryAttempts int64     `json:"delivery_attempts"`
	DeliveryStatus   string    `json:"delivery_status"`
	ErrorMessage     string    `json:"error_message" api:"nullable"`
	// The exact event body that was delivered, or attempted, for this record. One of
	// the three webhook envelopes: a message status change, an inbound message, or a
	// template status change. Read field and event to tell which, the same way your
	// endpoint does.
	EventData             WebhookListEventsResponseDataEventEventDataUnion `json:"event_data"`
	EventType             string                                           `json:"event_type"`
	HTTPStatusCode        int64                                            `json:"http_status_code" api:"nullable"`
	ProcessingCompletedAt time.Time                                        `json:"processing_completed_at" api:"nullable" format:"date-time"`
	ProcessingStartedAt   time.Time                                        `json:"processing_started_at" api:"nullable" format:"date-time"`
	ResponseBody          string                                           `json:"response_body" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		CreatedAt             respjson.Field
		DeliveryAttempts      respjson.Field
		DeliveryStatus        respjson.Field
		ErrorMessage          respjson.Field
		EventData             respjson.Field
		EventType             respjson.Field
		HTTPStatusCode        respjson.Field
		ProcessingCompletedAt respjson.Field
		ProcessingStartedAt   respjson.Field
		ResponseBody          respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookListEventsResponseDataEvent) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*WebhookListEventsResponseDataEvent) UnmarshalJSON added in v0.7.0

func (r *WebhookListEventsResponseDataEvent) UnmarshalJSON(data []byte) error

type WebhookListEventsResponseDataEventEventDataUnion added in v0.31.0

type WebhookListEventsResponseDataEventEventDataUnion struct {
	Event string `json:"event"`
	Field string `json:"field"`
	// This field is a union of [MessageEventPayload], [InboundMessageEventPayload],
	// [TemplateEventPayload]
	Payload   WebhookListEventsResponseDataEventEventDataUnionPayload `json:"payload"`
	Timestamp string                                                  `json:"timestamp"`
	JSON      struct {
		Event     respjson.Field
		Field     respjson.Field
		Payload   respjson.Field
		Timestamp respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebhookListEventsResponseDataEventEventDataUnion contains all possible properties and values from MessageEvent, InboundMessageEvent, TemplateEvent.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (WebhookListEventsResponseDataEventEventDataUnion) AsInboundMessageEvent added in v0.31.0

func (WebhookListEventsResponseDataEventEventDataUnion) AsMessageEvent added in v0.31.0

func (WebhookListEventsResponseDataEventEventDataUnion) AsTemplateEvent added in v0.31.0

func (WebhookListEventsResponseDataEventEventDataUnion) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*WebhookListEventsResponseDataEventEventDataUnion) UnmarshalJSON added in v0.31.0

type WebhookListEventsResponseDataEventEventDataUnionPayload added in v0.31.0

type WebhookListEventsResponseDataEventEventDataUnionPayload struct {
	AccountID string `json:"account_id"`
	// This field is from variant [MessageEventPayload].
	AgentID   string `json:"agent_id"`
	Channel   string `json:"channel"`
	MessageID string `json:"message_id"`
	// This field is from variant [MessageEventPayload].
	MessageStatus  string `json:"message_status"`
	OutboundNumber string `json:"outbound_number"`
	TemplateID     string `json:"template_id"`
	TemplateName   string `json:"template_name"`
	UpdatedAt      string `json:"updated_at"`
	// This field is from variant [InboundMessageEventPayload].
	InboundNumber string `json:"inbound_number"`
	// This field is from variant [InboundMessageEventPayload].
	ReceivedAt string `json:"received_at"`
	// This field is from variant [InboundMessageEventPayload].
	Text string `json:"text"`
	// This field is from variant [TemplateEventPayload].
	Category string `json:"category"`
	// This field is from variant [TemplateEventPayload].
	Language string `json:"language"`
	// This field is from variant [TemplateEventPayload].
	Reason string `json:"reason"`
	// This field is from variant [TemplateEventPayload].
	Status string `json:"status"`
	// This field is from variant [TemplateEventPayload].
	WhatsappTemplateID string `json:"whatsapp_template_id"`
	JSON               struct {
		AccountID          respjson.Field
		AgentID            respjson.Field
		Channel            respjson.Field
		MessageID          respjson.Field
		MessageStatus      respjson.Field
		OutboundNumber     respjson.Field
		TemplateID         respjson.Field
		TemplateName       respjson.Field
		UpdatedAt          respjson.Field
		InboundNumber      respjson.Field
		ReceivedAt         respjson.Field
		Text               respjson.Field
		Category           respjson.Field
		Language           respjson.Field
		Reason             respjson.Field
		Status             respjson.Field
		WhatsappTemplateID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebhookListEventsResponseDataEventEventDataUnionPayload is an implicit subunion of WebhookListEventsResponseDataEventEventDataUnion. WebhookListEventsResponseDataEventEventDataUnionPayload provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the WebhookListEventsResponseDataEventEventDataUnion.

func (*WebhookListEventsResponseDataEventEventDataUnionPayload) UnmarshalJSON added in v0.31.0

type WebhookListEventsResponseDataPagination added in v0.23.0

type WebhookListEventsResponseDataPagination struct {
	// Cursor-based pagination. Never populated — see Cursors.
	//
	// Deprecated: deprecated
	Cursors WebhookListEventsResponseDataPaginationCursors `json:"cursors" api:"nullable"`
	// Whether there are more pages after this one
	HasMore bool `json:"has_more"`
	// Current page number (1-indexed)
	Page int64 `json:"page"`
	// Number of items per page
	PageSize int64 `json:"page_size"`
	// Total number of items across all pages
	TotalCount int64 `json:"total_count"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cursors     respjson.Field
		HasMore     respjson.Field
		Page        respjson.Field
		PageSize    respjson.Field
		TotalCount  respjson.Field
		TotalPages  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata for list responses

func (WebhookListEventsResponseDataPagination) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookListEventsResponseDataPagination) UnmarshalJSON added in v0.23.0

func (r *WebhookListEventsResponseDataPagination) UnmarshalJSON(data []byte) error

type WebhookListEventsResponseDataPaginationCursors deprecated added in v0.23.0

type WebhookListEventsResponseDataPaginationCursors struct {
	// Cursor to fetch the next page.
	After string `json:"after" api:"nullable"`
	// Cursor to fetch the previous page.
	Before string `json:"before" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cursor-based pagination. Never populated — see Cursors.

Deprecated: deprecated

func (WebhookListEventsResponseDataPaginationCursors) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookListEventsResponseDataPaginationCursors) UnmarshalJSON added in v0.23.0

type WebhookListEventsResponseError added in v0.23.0

type WebhookListEventsResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (WebhookListEventsResponseError) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookListEventsResponseError) UnmarshalJSON added in v0.23.0

func (r *WebhookListEventsResponseError) UnmarshalJSON(data []byte) error

type WebhookListEventsResponseMeta added in v0.23.0

type WebhookListEventsResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (WebhookListEventsResponseMeta) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookListEventsResponseMeta) UnmarshalJSON added in v0.23.0

func (r *WebhookListEventsResponseMeta) UnmarshalJSON(data []byte) error

type WebhookListParams added in v0.7.0

type WebhookListParams struct {
	Page       int64             `query:"page" api:"required" json:"-"`
	PageSize   int64             `query:"page_size" api:"required" json:"-"`
	IsActive   param.Opt[bool]   `query:"is_active,omitzero" json:"-"`
	Search     param.Opt[string] `query:"search,omitzero" json:"-"`
	XProfileID param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (WebhookListParams) URLQuery added in v0.7.0

func (r WebhookListParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebhookListParams's query parameters as `url.Values`.

type WebhookListResponse added in v0.7.0

type WebhookListResponse struct {
	// A paginated list of webhooks.
	Data WebhookListResponseData `json:"data" api:"nullable"`
	// Error information
	Error WebhookListResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta WebhookListResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (WebhookListResponse) RawJSON added in v0.7.0

func (r WebhookListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookListResponse) UnmarshalJSON added in v0.7.0

func (r *WebhookListResponse) UnmarshalJSON(data []byte) error

type WebhookListResponseData added in v0.7.0

type WebhookListResponseData struct {
	// Pagination metadata for list responses
	Pagination WebhookListResponseDataPagination `json:"pagination"`
	// The webhooks on this page.
	Webhooks []WebhookListResponseDataWebhook `json:"webhooks"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Pagination  respjson.Field
		Webhooks    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A paginated list of webhooks.

func (WebhookListResponseData) RawJSON added in v0.7.0

func (r WebhookListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookListResponseData) UnmarshalJSON added in v0.7.0

func (r *WebhookListResponseData) UnmarshalJSON(data []byte) error

type WebhookListResponseDataPagination added in v0.23.0

type WebhookListResponseDataPagination struct {
	// Cursor-based pagination. Never populated — see Cursors.
	//
	// Deprecated: deprecated
	Cursors WebhookListResponseDataPaginationCursors `json:"cursors" api:"nullable"`
	// Whether there are more pages after this one
	HasMore bool `json:"has_more"`
	// Current page number (1-indexed)
	Page int64 `json:"page"`
	// Number of items per page
	PageSize int64 `json:"page_size"`
	// Total number of items across all pages
	TotalCount int64 `json:"total_count"`
	// Total number of pages
	TotalPages int64 `json:"total_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cursors     respjson.Field
		HasMore     respjson.Field
		Page        respjson.Field
		PageSize    respjson.Field
		TotalCount  respjson.Field
		TotalPages  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination metadata for list responses

func (WebhookListResponseDataPagination) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookListResponseDataPagination) UnmarshalJSON added in v0.23.0

func (r *WebhookListResponseDataPagination) UnmarshalJSON(data []byte) error

type WebhookListResponseDataPaginationCursors deprecated added in v0.23.0

type WebhookListResponseDataPaginationCursors struct {
	// Cursor to fetch the next page.
	After string `json:"after" api:"nullable"`
	// Cursor to fetch the previous page.
	Before string `json:"before" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cursor-based pagination. Never populated — see Cursors.

Deprecated: deprecated

func (WebhookListResponseDataPaginationCursors) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookListResponseDataPaginationCursors) UnmarshalJSON added in v0.23.0

func (r *WebhookListResponseDataPaginationCursors) UnmarshalJSON(data []byte) error

type WebhookListResponseDataWebhook added in v0.23.0

type WebhookListResponseDataWebhook struct {
	ID                  string    `json:"id" format:"uuid"`
	ConsecutiveFailures int64     `json:"consecutive_failures"`
	CreatedAt           time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID               string              `json:"customer_id" format:"uuid"`
	DisplayName              string              `json:"display_name"`
	EndpointURL              string              `json:"endpoint_url"`
	EventFilters             map[string][]string `json:"event_filters" api:"nullable"`
	EventTypes               []string            `json:"event_types"`
	IsActive                 bool                `json:"is_active"`
	LastDeliveryAttemptAt    time.Time           `json:"last_delivery_attempt_at" api:"nullable" format:"date-time"`
	LastSuccessfulDeliveryAt time.Time           `json:"last_successful_delivery_at" api:"nullable" format:"date-time"`
	RetryCount               int64               `json:"retry_count"`
	SigningSecret            string              `json:"signing_secret" api:"nullable"`
	TimeoutSeconds           int64               `json:"timeout_seconds"`
	UpdatedAt                time.Time           `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		ConsecutiveFailures      respjson.Field
		CreatedAt                respjson.Field
		CustomerID               respjson.Field
		DisplayName              respjson.Field
		EndpointURL              respjson.Field
		EventFilters             respjson.Field
		EventTypes               respjson.Field
		IsActive                 respjson.Field
		LastDeliveryAttemptAt    respjson.Field
		LastSuccessfulDeliveryAt respjson.Field
		RetryCount               respjson.Field
		SigningSecret            respjson.Field
		TimeoutSeconds           respjson.Field
		UpdatedAt                respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookListResponseDataWebhook) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookListResponseDataWebhook) UnmarshalJSON added in v0.23.0

func (r *WebhookListResponseDataWebhook) UnmarshalJSON(data []byte) error

type WebhookListResponseError added in v0.23.0

type WebhookListResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (WebhookListResponseError) RawJSON added in v0.23.0

func (r WebhookListResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookListResponseError) UnmarshalJSON added in v0.23.0

func (r *WebhookListResponseError) UnmarshalJSON(data []byte) error

type WebhookListResponseMeta added in v0.23.0

type WebhookListResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (WebhookListResponseMeta) RawJSON added in v0.23.0

func (r WebhookListResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookListResponseMeta) UnmarshalJSON added in v0.23.0

func (r *WebhookListResponseMeta) UnmarshalJSON(data []byte) error

type WebhookNewParams added in v0.7.0

type WebhookNewParams struct {
	DisplayName param.Opt[string] `json:"display_name,omitzero"`
	EndpointURL param.Opt[string] `json:"endpoint_url,omitzero"`
	RetryCount  param.Opt[int64]  `json:"retry_count,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]     `json:"sandbox,omitzero"`
	TimeoutSeconds param.Opt[int64]    `json:"timeout_seconds,omitzero"`
	IdempotencyKey param.Opt[string]   `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string]   `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	EventFilters   map[string][]string `json:"event_filters,omitzero"`
	EventTypes     []string            `json:"event_types,omitzero"`
	// contains filtered or unexported fields
}

func (WebhookNewParams) MarshalJSON added in v0.7.0

func (r WebhookNewParams) MarshalJSON() (data []byte, err error)

func (*WebhookNewParams) UnmarshalJSON added in v0.7.0

func (r *WebhookNewParams) UnmarshalJSON(data []byte) error

type WebhookNewResponse added in v0.23.0

type WebhookNewResponse struct {
	// The response data (null if error)
	Data WebhookNewResponseData `json:"data" api:"nullable"`
	// Error information
	Error WebhookNewResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta WebhookNewResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (WebhookNewResponse) RawJSON added in v0.23.0

func (r WebhookNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookNewResponse) UnmarshalJSON added in v0.23.0

func (r *WebhookNewResponse) UnmarshalJSON(data []byte) error

type WebhookNewResponseData added in v0.23.0

type WebhookNewResponseData struct {
	ID                  string    `json:"id" format:"uuid"`
	ConsecutiveFailures int64     `json:"consecutive_failures"`
	CreatedAt           time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID               string              `json:"customer_id" format:"uuid"`
	DisplayName              string              `json:"display_name"`
	EndpointURL              string              `json:"endpoint_url"`
	EventFilters             map[string][]string `json:"event_filters" api:"nullable"`
	EventTypes               []string            `json:"event_types"`
	IsActive                 bool                `json:"is_active"`
	LastDeliveryAttemptAt    time.Time           `json:"last_delivery_attempt_at" api:"nullable" format:"date-time"`
	LastSuccessfulDeliveryAt time.Time           `json:"last_successful_delivery_at" api:"nullable" format:"date-time"`
	RetryCount               int64               `json:"retry_count"`
	SigningSecret            string              `json:"signing_secret" api:"nullable"`
	TimeoutSeconds           int64               `json:"timeout_seconds"`
	UpdatedAt                time.Time           `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		ConsecutiveFailures      respjson.Field
		CreatedAt                respjson.Field
		CustomerID               respjson.Field
		DisplayName              respjson.Field
		EndpointURL              respjson.Field
		EventFilters             respjson.Field
		EventTypes               respjson.Field
		IsActive                 respjson.Field
		LastDeliveryAttemptAt    respjson.Field
		LastSuccessfulDeliveryAt respjson.Field
		RetryCount               respjson.Field
		SigningSecret            respjson.Field
		TimeoutSeconds           respjson.Field
		UpdatedAt                respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The response data (null if error)

func (WebhookNewResponseData) RawJSON added in v0.23.0

func (r WebhookNewResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookNewResponseData) UnmarshalJSON added in v0.23.0

func (r *WebhookNewResponseData) UnmarshalJSON(data []byte) error

type WebhookNewResponseError added in v0.23.0

type WebhookNewResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (WebhookNewResponseError) RawJSON added in v0.23.0

func (r WebhookNewResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookNewResponseError) UnmarshalJSON added in v0.23.0

func (r *WebhookNewResponseError) UnmarshalJSON(data []byte) error

type WebhookNewResponseMeta added in v0.23.0

type WebhookNewResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (WebhookNewResponseMeta) RawJSON added in v0.23.0

func (r WebhookNewResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookNewResponseMeta) UnmarshalJSON added in v0.23.0

func (r *WebhookNewResponseMeta) UnmarshalJSON(data []byte) error

type WebhookRotateSecretParams added in v0.7.0

type WebhookRotateSecretParams struct {
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (WebhookRotateSecretParams) MarshalJSON added in v0.7.0

func (r WebhookRotateSecretParams) MarshalJSON() (data []byte, err error)

func (*WebhookRotateSecretParams) UnmarshalJSON added in v0.7.0

func (r *WebhookRotateSecretParams) UnmarshalJSON(data []byte) error

type WebhookRotateSecretResponse added in v0.7.0

type WebhookRotateSecretResponse struct {
	// The response data (null if error)
	Data WebhookRotateSecretResponseData `json:"data" api:"nullable"`
	// Error information
	Error WebhookRotateSecretResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta WebhookRotateSecretResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (WebhookRotateSecretResponse) RawJSON added in v0.7.0

func (r WebhookRotateSecretResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookRotateSecretResponse) UnmarshalJSON added in v0.7.0

func (r *WebhookRotateSecretResponse) UnmarshalJSON(data []byte) error

type WebhookRotateSecretResponseData added in v0.7.0

type WebhookRotateSecretResponseData struct {
	SigningSecret string `json:"signing_secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SigningSecret respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The response data (null if error)

func (WebhookRotateSecretResponseData) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*WebhookRotateSecretResponseData) UnmarshalJSON added in v0.7.0

func (r *WebhookRotateSecretResponseData) UnmarshalJSON(data []byte) error

type WebhookRotateSecretResponseError added in v0.23.0

type WebhookRotateSecretResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (WebhookRotateSecretResponseError) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookRotateSecretResponseError) UnmarshalJSON added in v0.23.0

func (r *WebhookRotateSecretResponseError) UnmarshalJSON(data []byte) error

type WebhookRotateSecretResponseMeta added in v0.23.0

type WebhookRotateSecretResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (WebhookRotateSecretResponseMeta) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookRotateSecretResponseMeta) UnmarshalJSON added in v0.23.0

func (r *WebhookRotateSecretResponseMeta) UnmarshalJSON(data []byte) error

type WebhookService added in v0.7.0

type WebhookService struct {
	Options []option.RequestOption
}

Delivery reports and inbound messages, pushed to you.

Subscribe an endpoint to the event types you care about — `GET /v3/webhooks/event-types` lists them — and we POST each one as it happens, retrying on failure. Polling `GET /v3/messages/{id}` works and does not scale.

**Verify the signature.** Every delivery is signed with your endpoint's secret; an unverified endpoint is one anybody can post to. `rotate-secret` replaces it, `test` sends a specimen event, and `GET /v3/webhooks/{id}/events` shows what we tried to deliver and what your endpoint answered — which is the first place to look when something appears to be missing.

WebhookService contains methods and other services that help with interacting with the Sent API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.

func NewWebhookService added in v0.7.0

func NewWebhookService(opts ...option.RequestOption) (r WebhookService)

NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*WebhookService) Delete added in v0.7.0

func (r *WebhookService) Delete(ctx context.Context, id string, body WebhookDeleteParams, opts ...option.RequestOption) (err error)

Deletes a webhook for the authenticated customer.

func (*WebhookService) Get added in v0.7.0

Retrieves a single webhook by ID for the authenticated customer.

func (*WebhookService) List added in v0.7.0

Retrieves a paginated list of webhooks for the authenticated customer.

func (*WebhookService) ListEventTypes added in v0.7.0

Retrieves all available webhook event types that can be subscribed to.

func (*WebhookService) ListEvents added in v0.7.0

Retrieves a paginated list of delivery events for the specified webhook.

func (*WebhookService) New added in v0.7.0

Creates a new webhook endpoint for the authenticated customer.

func (*WebhookService) RotateSecret added in v0.7.0

Generates a new signing secret for the specified webhook. The old secret is immediately invalidated.

func (*WebhookService) Test added in v0.7.0

func (r *WebhookService) Test(ctx context.Context, id string, params WebhookTestParams, opts ...option.RequestOption) (res *WebhookTestResponse, err error)

Sends a test event to the specified webhook endpoint to verify connectivity.

func (*WebhookService) ToggleStatus added in v0.7.0

Activates or deactivates a webhook for the authenticated customer.

func (*WebhookService) Update added in v0.7.0

Updates an existing webhook for the authenticated customer.

type WebhookTestParams added in v0.7.0

type WebhookTestParams struct {
	EventType param.Opt[string] `json:"event_type,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (WebhookTestParams) MarshalJSON added in v0.7.0

func (r WebhookTestParams) MarshalJSON() (data []byte, err error)

func (*WebhookTestParams) UnmarshalJSON added in v0.7.0

func (r *WebhookTestParams) UnmarshalJSON(data []byte) error

type WebhookTestResponse added in v0.7.0

type WebhookTestResponse struct {
	// The response data (null if error)
	Data WebhookTestResponseData `json:"data" api:"nullable"`
	// Error information
	Error WebhookTestResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta WebhookTestResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (WebhookTestResponse) RawJSON added in v0.7.0

func (r WebhookTestResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookTestResponse) UnmarshalJSON added in v0.7.0

func (r *WebhookTestResponse) UnmarshalJSON(data []byte) error

type WebhookTestResponseData added in v0.7.0

type WebhookTestResponseData struct {
	Message string `json:"message"`
	Success bool   `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The response data (null if error)

func (WebhookTestResponseData) RawJSON added in v0.7.0

func (r WebhookTestResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookTestResponseData) UnmarshalJSON added in v0.7.0

func (r *WebhookTestResponseData) UnmarshalJSON(data []byte) error

type WebhookTestResponseError added in v0.23.0

type WebhookTestResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (WebhookTestResponseError) RawJSON added in v0.23.0

func (r WebhookTestResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookTestResponseError) UnmarshalJSON added in v0.23.0

func (r *WebhookTestResponseError) UnmarshalJSON(data []byte) error

type WebhookTestResponseMeta added in v0.23.0

type WebhookTestResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (WebhookTestResponseMeta) RawJSON added in v0.23.0

func (r WebhookTestResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookTestResponseMeta) UnmarshalJSON added in v0.23.0

func (r *WebhookTestResponseMeta) UnmarshalJSON(data []byte) error

type WebhookToggleStatusParams added in v0.7.0

type WebhookToggleStatusParams struct {
	IsActive param.Opt[bool] `json:"is_active,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]   `json:"sandbox,omitzero"`
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string] `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (WebhookToggleStatusParams) MarshalJSON added in v0.7.0

func (r WebhookToggleStatusParams) MarshalJSON() (data []byte, err error)

func (*WebhookToggleStatusParams) UnmarshalJSON added in v0.7.0

func (r *WebhookToggleStatusParams) UnmarshalJSON(data []byte) error

type WebhookToggleStatusResponse added in v0.23.0

type WebhookToggleStatusResponse struct {
	// The response data (null if error)
	Data WebhookToggleStatusResponseData `json:"data" api:"nullable"`
	// Error information
	Error WebhookToggleStatusResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta WebhookToggleStatusResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (WebhookToggleStatusResponse) RawJSON added in v0.23.0

func (r WebhookToggleStatusResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookToggleStatusResponse) UnmarshalJSON added in v0.23.0

func (r *WebhookToggleStatusResponse) UnmarshalJSON(data []byte) error

type WebhookToggleStatusResponseData added in v0.23.0

type WebhookToggleStatusResponseData struct {
	ID                  string    `json:"id" format:"uuid"`
	ConsecutiveFailures int64     `json:"consecutive_failures"`
	CreatedAt           time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID               string              `json:"customer_id" format:"uuid"`
	DisplayName              string              `json:"display_name"`
	EndpointURL              string              `json:"endpoint_url"`
	EventFilters             map[string][]string `json:"event_filters" api:"nullable"`
	EventTypes               []string            `json:"event_types"`
	IsActive                 bool                `json:"is_active"`
	LastDeliveryAttemptAt    time.Time           `json:"last_delivery_attempt_at" api:"nullable" format:"date-time"`
	LastSuccessfulDeliveryAt time.Time           `json:"last_successful_delivery_at" api:"nullable" format:"date-time"`
	RetryCount               int64               `json:"retry_count"`
	SigningSecret            string              `json:"signing_secret" api:"nullable"`
	TimeoutSeconds           int64               `json:"timeout_seconds"`
	UpdatedAt                time.Time           `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		ConsecutiveFailures      respjson.Field
		CreatedAt                respjson.Field
		CustomerID               respjson.Field
		DisplayName              respjson.Field
		EndpointURL              respjson.Field
		EventFilters             respjson.Field
		EventTypes               respjson.Field
		IsActive                 respjson.Field
		LastDeliveryAttemptAt    respjson.Field
		LastSuccessfulDeliveryAt respjson.Field
		RetryCount               respjson.Field
		SigningSecret            respjson.Field
		TimeoutSeconds           respjson.Field
		UpdatedAt                respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The response data (null if error)

func (WebhookToggleStatusResponseData) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookToggleStatusResponseData) UnmarshalJSON added in v0.23.0

func (r *WebhookToggleStatusResponseData) UnmarshalJSON(data []byte) error

type WebhookToggleStatusResponseError added in v0.23.0

type WebhookToggleStatusResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (WebhookToggleStatusResponseError) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookToggleStatusResponseError) UnmarshalJSON added in v0.23.0

func (r *WebhookToggleStatusResponseError) UnmarshalJSON(data []byte) error

type WebhookToggleStatusResponseMeta added in v0.23.0

type WebhookToggleStatusResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (WebhookToggleStatusResponseMeta) RawJSON added in v0.23.0

Returns the unmodified JSON received from the API

func (*WebhookToggleStatusResponseMeta) UnmarshalJSON added in v0.23.0

func (r *WebhookToggleStatusResponseMeta) UnmarshalJSON(data []byte) error

type WebhookUpdateParams added in v0.7.0

type WebhookUpdateParams struct {
	DisplayName param.Opt[string] `json:"display_name,omitzero"`
	EndpointURL param.Opt[string] `json:"endpoint_url,omitzero"`
	RetryCount  param.Opt[int64]  `json:"retry_count,omitzero"`
	// Sandbox flag - when true, the operation is simulated without side effects Useful
	// for testing integrations without actual execution
	Sandbox        param.Opt[bool]     `json:"sandbox,omitzero"`
	TimeoutSeconds param.Opt[int64]    `json:"timeout_seconds,omitzero"`
	IdempotencyKey param.Opt[string]   `header:"Idempotency-Key,omitzero" json:"-"`
	XProfileID     param.Opt[string]   `header:"x-profile-id,omitzero" format:"uuid" json:"-"`
	EventFilters   map[string][]string `json:"event_filters,omitzero"`
	EventTypes     []string            `json:"event_types,omitzero"`
	// contains filtered or unexported fields
}

func (WebhookUpdateParams) MarshalJSON added in v0.7.0

func (r WebhookUpdateParams) MarshalJSON() (data []byte, err error)

func (*WebhookUpdateParams) UnmarshalJSON added in v0.7.0

func (r *WebhookUpdateParams) UnmarshalJSON(data []byte) error

type WebhookUpdateResponse added in v0.23.0

type WebhookUpdateResponse struct {
	// The response data (null if error)
	Data WebhookUpdateResponseData `json:"data" api:"nullable"`
	// Error information
	Error WebhookUpdateResponseError `json:"error" api:"nullable"`
	// Request and response metadata
	Meta WebhookUpdateResponseMeta `json:"meta"`
	// Indicates whether the request was successful
	Success bool `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Error       respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standard API response envelope for all v3 endpoints

func (WebhookUpdateResponse) RawJSON added in v0.23.0

func (r WebhookUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookUpdateResponse) UnmarshalJSON added in v0.23.0

func (r *WebhookUpdateResponse) UnmarshalJSON(data []byte) error

type WebhookUpdateResponseData added in v0.23.0

type WebhookUpdateResponseData struct {
	ID                  string    `json:"id" format:"uuid"`
	ConsecutiveFailures int64     `json:"consecutive_failures"`
	CreatedAt           time.Time `json:"created_at" format:"date-time"`
	// Which customer owns this — the key's own, or the profile named in x-profile-id.
	// Says whose resource this is, which the resource's own id does not.
	CustomerID               string              `json:"customer_id" format:"uuid"`
	DisplayName              string              `json:"display_name"`
	EndpointURL              string              `json:"endpoint_url"`
	EventFilters             map[string][]string `json:"event_filters" api:"nullable"`
	EventTypes               []string            `json:"event_types"`
	IsActive                 bool                `json:"is_active"`
	LastDeliveryAttemptAt    time.Time           `json:"last_delivery_attempt_at" api:"nullable" format:"date-time"`
	LastSuccessfulDeliveryAt time.Time           `json:"last_successful_delivery_at" api:"nullable" format:"date-time"`
	RetryCount               int64               `json:"retry_count"`
	SigningSecret            string              `json:"signing_secret" api:"nullable"`
	TimeoutSeconds           int64               `json:"timeout_seconds"`
	UpdatedAt                time.Time           `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		ConsecutiveFailures      respjson.Field
		CreatedAt                respjson.Field
		CustomerID               respjson.Field
		DisplayName              respjson.Field
		EndpointURL              respjson.Field
		EventFilters             respjson.Field
		EventTypes               respjson.Field
		IsActive                 respjson.Field
		LastDeliveryAttemptAt    respjson.Field
		LastSuccessfulDeliveryAt respjson.Field
		RetryCount               respjson.Field
		SigningSecret            respjson.Field
		TimeoutSeconds           respjson.Field
		UpdatedAt                respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The response data (null if error)

func (WebhookUpdateResponseData) RawJSON added in v0.23.0

func (r WebhookUpdateResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookUpdateResponseData) UnmarshalJSON added in v0.23.0

func (r *WebhookUpdateResponseData) UnmarshalJSON(data []byte) error

type WebhookUpdateResponseError added in v0.23.0

type WebhookUpdateResponseError struct {
	// Machine-readable error code (e.g., "RESOURCE_001")
	Code string `json:"code"`
	// Additional validation error details (field-level errors)
	Details map[string][]string `json:"details" api:"nullable"`
	// URL to documentation about this error
	DocURL string `json:"doc_url" api:"nullable"`
	// Human-readable error message
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		DocURL      respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error information

func (WebhookUpdateResponseError) RawJSON added in v0.23.0

func (r WebhookUpdateResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookUpdateResponseError) UnmarshalJSON added in v0.23.0

func (r *WebhookUpdateResponseError) UnmarshalJSON(data []byte) error

type WebhookUpdateResponseMeta added in v0.23.0

type WebhookUpdateResponseMeta struct {
	// Unique identifier for this request (for tracing and support)
	RequestID string `json:"request_id"`
	// Server timestamp when the response was generated
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// API version used for this request
	Version string `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Timestamp   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request and response metadata

func (WebhookUpdateResponseMeta) RawJSON added in v0.23.0

func (r WebhookUpdateResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookUpdateResponseMeta) UnmarshalJSON added in v0.23.0

func (r *WebhookUpdateResponseMeta) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL