Pular para o conteúdo

Cadastrar um endpoint

POST
/v1/endpoints

Cadastra uma URL de um Consumer e os tipos de evento que ela recebe. Sem events, ela recebe todos os tipos, inclusive os cadastrados depois.

A resposta traz o secret que assina as entregas, e ele aparece só aqui: guarde-o. Depois disso, o único jeito de ter outro é rotacionar.

A URL é validada no cadastro e de novo a cada entrega: https obrigatório em produção, portas 80 e 443, sem credenciais embutidas, e o host não pode resolver para rede privada.

Corpo da requisiçãoobrigatório

Seção intitulada “Request Bodyrequired”
Tipo de mídiaapplication/json
object
consumer
obrigatório
null | string
url
obrigatório
null | string
description
obrigatório
null | string
events
obrigatório
Array<string> | null
Exemplo
{
"consumer": "cliente-42",
"url": "https://padariadoze.com.br/webhooks",
"events": [
"pedido.pago"
]
}

Criado.

Tipo de mídiaapplication/json
object
id
obrigatório
string
url
obrigatório
string
events
obrigatório
Array<string>
secret
obrigatório
string
Exemplo
{
"id": "ep_01JB8Y1D6TQ4X8N2VK5HWZ3RFM",
"url": "https://padariadoze.com.br/webhooks",
"events": [
"pedido.pago"
],
"secret": "whsec_…"
}

Chave de API ausente, inválida ou revogada.

O limite de endpoints do plano foi atingido.

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"
}

consumer ou url ausente, Consumer ou tipo de evento não cadastrado, ou URL recusada pela validação.

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.