DestinationsStore or rotate a credential

Store or rotate a credential

Store (or rotate, by re-sending) a credential for a credential-backed destination type. Requires an agency (ak_) key. A given (destination_type, credential_name) pair is upserted in place. google_ads credential values must be a JSON object containing client_id, client_secret, and refresh_token, minted against the https://www.googleapis.com/auth/datamanager OAuth scope. The response echoes metadata only — never the credential value.

curl -X PUT "https://mythic-analytics.gulp.workers.dev/client/v1/destinations/credentials/meta_capi" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "credential_value": "example_string",
  "credential_name": "John Doe"
}'
{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "destination_type": "meta_capi",
    "credential_name": "default",
    "created_at": "2024-12-25T10:00:00Z",
    "updated_at": "2024-12-25T10:00:00Z"
  }
}
PUT
/client/v1/destinations/credentials/{type}
PUT
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need destinations:read or destinations:write. See Using an mcp_ key over HTTP.

Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need destinations:read or destinations:write. See Using an mcp_ key over HTTP.
path
typestring
Required

Destination type the credential belongs to. convert_experiments is a special case: delivering to Convert needs no credential at all, but reading Convert's report to verify a delivery does, so its only valid credential_name is reporting.

Options: meta_capi, google_ads, google_analytics, openai_ads, convert_experiments
Content-Typestring
Required

The media type of the request body

Options: application/json
credential_valuestring
Required

Secret value, max 8KB. For google_ads this must be a JSON object string containing client_id, client_secret, and refresh_token (plus an optional login_customer_id for manager-account access). The refresh token must carry the https://www.googleapis.com/auth/datamanager OAuth scope.

credential_namestring

Name for this credential. Defaults to default.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need destinations:read or destinations:write. See Using an mcp_ key over HTTP.

Path Parameters

typestring
Required

Destination type the credential belongs to. convert_experiments is a special case: delivering to Convert needs no credential at all, but reading Convert's report to verify a delivery does, so its only valid credential_name is reporting.

Allowed values:meta_capigoogle_adsgoogle_analyticsopenai_adsconvert_experiments

Body

application/json
credential_valuestring
Required

Secret value, max 8KB. For google_ads this must be a JSON object string containing client_id, client_secret, and refresh_token (plus an optional login_customer_id for manager-account access). The refresh token must carry the https://www.googleapis.com/auth/datamanager OAuth scope.

credential_namestring

Name for this credential. Defaults to default.

Responses

successboolean
dataobject