Skip to main content
PATCH
/
contact-channels
/
{user_id}
/
{contact_channel_id}
Update a contact channel
curl --request PATCH \
  --url https://api.stack-auth.com/api/v1/contact-channels/{user_id}/{contact_channel_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "value": "johndoe@example.com",
  "type": "email",
  "used_for_auth": true,
  "is_primary": true
}
'
{
  "user_id": "3241a285-8329-4d69-8f3d-316e08cf140c",
  "id": "b3d396b8-c574-4c80-97b3-50031675ceb2",
  "value": "johndoe@example.com",
  "type": "email",
  "used_for_auth": true,
  "is_verified": true,
  "is_primary": true
}

Documentation Index

Fetch the complete documentation index at: https://stackauth-e0affa27-chore-move-mcp-to-a-sep-app.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Path Parameters

user_id
string
required

the user that the contact channel belongs to

Example:

"me"

contact_channel_id
string
required

the target contact channel

Example:

"b3d396b8-c574-4c80-97b3-50031675ceb2"

Query Parameters

user_id
string

The ID of the user, or the special value me for the currently authenticated user

Example:

"3241a285-8329-4d69-8f3d-316e08cf140c"

contact_channel_id
string

Body

application/json
value
string

The value of the contact channel. For email, this should be a valid email address.

Example:

"johndoe@example.com"

type
string

The type of the contact channel. Currently only "email" is supported.

Example:

"email"

used_for_auth
boolean

Whether the contact channel is used for authentication. If this is set to true, the user will be able to sign in with the contact channel with password or OTP.

Example:

true

is_primary
boolean

Whether the contact channel is the primary contact channel. If this is set to true, it will be used for authentication and notifications by default.

Example:

true

Response

200 - application/json

Successful response

user_id
string
required

The unique identifier of the user

Example:

"3241a285-8329-4d69-8f3d-316e08cf140c"

id
string
required

The unique identifier of the contact channel

Example:

"b3d396b8-c574-4c80-97b3-50031675ceb2"

value
string
required

The value of the contact channel. For email, this should be a valid email address.

Example:

"johndoe@example.com"

type
string
required

The type of the contact channel. Currently only "email" is supported.

Example:

"email"

used_for_auth
boolean
required

Whether the contact channel is used for authentication. If this is set to true, the user will be able to sign in with the contact channel with password or OTP.

Example:

true

is_verified
boolean
required

Whether the contact channel has been verified. If this is set to true, the contact channel has been verified to belong to the user.

Example:

true

is_primary
boolean
required

Whether the contact channel is the primary contact channel. If this is set to true, it will be used for authentication and notifications by default.

Example:

true