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"
}'
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/client/v1/destinations/credentials/meta_capi"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"credential_value": "example_string",
"credential_name": "John Doe"
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/client/v1/destinations/credentials/meta_capi", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"credential_value": "example_string",
"credential_name": "John Doe"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"credential_value": "example_string",
"credential_name": "John Doe"
}`)
req, err := http.NewRequest("PUT", "https://mythic-analytics.gulp.workers.dev/client/v1/destinations/credentials/meta_capi", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://mythic-analytics.gulp.workers.dev/client/v1/destinations/credentials/meta_capi')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"credential_value": "example_string",
"credential_name": "John Doe"
}'
response = http.request(request)
puts response.body
{
"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"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please try again later",
"code": 429,
"retryAfter": 3600
}
{
"error": "Error",
"message": "Upstream data store returned an error.",
"code": 502
}
/client/v1/destinations/credentials/{type}Target server for requests. Edit to use your own host.
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.
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.
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.
The media type of the request body
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.
Name for this credential. Defaults to default.
Request Preview
Response
Response will appear here after sending the request
Authentication
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
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.
meta_capigoogle_adsgoogle_analyticsopenai_adsconvert_experimentsBody
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.
Name for this credential. Defaults to default.