Replace a connection's token
Store a new token in place of the old one. Every source that uses the connection reads with it from its next sync. The site and service do not change.
curl --request POST "$MITHUNAI_URL/mithunai/api/v1/connections/$CONNECTION_ID/rotate" \
--header "Authorization: Bearer $MITHUNAI_API_KEY" \
--header "Content-Type: application/json" \
--data '{"fields": {"token": "'"$NEW_NOTION_TOKEN"'"}}'
{
"id": "6f1c2b9a-4d3e-4a8b-9c7d-2e1f0a9b8c7d",
"name": "Docs team Notion",
"kind": "notion",
"host": "",
"source_count": 1,
"created_at": "2026-10-13T09:00:00+00:00",
"updated_at": "2026-11-02T08:30:00+00:00",
"rotated_at": "2026-11-02T08:30:00+00:00",
"last_used_at": "2026-11-01T06:00:12+00:00"
}
{
"code": "validation_error",
"message": "This kind of connection does not take one of the fields that were sent."
}
Replaces the token of a connection. Its name, its service and, for Confluence, its site stay as they are, and every source that uses it reads with the new token from its next sync. The response does not contain the token. You need the owner or admin role (
credential.manage).
Send only the service’s sign-in fields. site_url is refused with 400: a connection cannot be moved to another site.
string
required
The connection’s ID (UUID).
object
required
For
github, notion, grafana, hubspot, slack, stripe and okta: token. For
atlassian and zendesk: email and api_token. For wordpress: username and
application_password. For google_workspace: service_account_json and admin_email. For
microsoft_entra: tenant_id, client_id and client_secret. All strings.Response
Returns200 with the connection, rotated_at set to now.
curl --request POST "$MITHUNAI_URL/mithunai/api/v1/connections/$CONNECTION_ID/rotate" \
--header "Authorization: Bearer $MITHUNAI_API_KEY" \
--header "Content-Type: application/json" \
--data '{"fields": {"token": "'"$NEW_NOTION_TOKEN"'"}}'
{
"id": "6f1c2b9a-4d3e-4a8b-9c7d-2e1f0a9b8c7d",
"name": "Docs team Notion",
"kind": "notion",
"host": "",
"source_count": 1,
"created_at": "2026-10-13T09:00:00+00:00",
"updated_at": "2026-11-02T08:30:00+00:00",
"rotated_at": "2026-11-02T08:30:00+00:00",
"last_used_at": "2026-11-01T06:00:12+00:00"
}
{
"code": "validation_error",
"message": "This kind of connection does not take one of the fields that were sent."
}
Last modified on November 7, 2026
curl --request POST "$MITHUNAI_URL/mithunai/api/v1/connections/$CONNECTION_ID/rotate" \
--header "Authorization: Bearer $MITHUNAI_API_KEY" \
--header "Content-Type: application/json" \
--data '{"fields": {"token": "'"$NEW_NOTION_TOKEN"'"}}'
{
"id": "6f1c2b9a-4d3e-4a8b-9c7d-2e1f0a9b8c7d",
"name": "Docs team Notion",
"kind": "notion",
"host": "",
"source_count": 1,
"created_at": "2026-10-13T09:00:00+00:00",
"updated_at": "2026-11-02T08:30:00+00:00",
"rotated_at": "2026-11-02T08:30:00+00:00",
"last_used_at": "2026-11-01T06:00:12+00:00"
}
{
"code": "validation_error",
"message": "This kind of connection does not take one of the fields that were sent."
}