Pular para o conteúdo

Cadastrar ou alterar um Consumer

PUT
/v1/consumers/{externalId}

Cria o Consumer se o externalId ainda não existe no ambiente, e o altera se já existe. Devolve 201 no primeiro caso e 200 no segundo.

É o caminho do cadastro: chame no momento em que o seu cliente entra, sem precisar guardar estado do seu lado nem tratar 409.

O caminho aceita só externalId. Um id nosso (csm_…) que não existe devolve 404, porque o id é gerado aqui e não pode vir escolhido de fora.

externalId
obrigatório
string

Corpo da requisiçãoobrigatório

Seção intitulada “Request Bodyrequired”
Tipo de mídiaapplication/json
object
name
obrigatório
null | string
metadata
obrigatório
null | object
Exemplo
{
"name": "Padaria do Zé"
}

Sucesso.

Tipo de mídiaapplication/json
object
id
obrigatório
string
externalId
obrigatório
string
name
obrigatório
string
metadata
obrigatório
null | object
createdAt
obrigatório
string formato: date-time
Exemplogerado
{
"id": "example",
"externalId": "example",
"name": "example",
"metadata": "example",
"createdAt": "2026-04-15T12:00:00Z"
}

Criado.

Tipo de mídiaapplication/json
object
id
obrigatório
string
externalId
obrigatório
string
name
obrigatório
string
metadata
obrigatório
null | object
createdAt
obrigatório
string formato: date-time
Exemplogerado
{
"id": "example",
"externalId": "example",
"name": "example",
"metadata": "example",
"createdAt": "2026-04-15T12:00:00Z"
}

Chave de API ausente, inválida ou revogada.

Não encontrado.

Tipo de mídiaapplication/problem+json
object
type
null | string
title
null | string
status
null | integer | string formato: int32
/^-?(?:0|[1-9]\d*)$/
detail
null | string
instance
null | string
Exemplogerado
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Pedido inválido. O motivo vem em title.

Tipo de mídiaapplication/problem+json
object
type
null | string
title
null | string
status
null | integer | string formato: int32
/^-?(?:0|[1-9]\d*)$/
detail
null | string
instance
null | string
Exemplogerado
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Limite de requisições por segundo do plano, somado entre todas as chaves da organização.

Retry-After
integer

Segundos até a próxima janela.