Get deployment
curl --request GET \
--url https://macaly.com/api/chat/{chatId}/deployment \
--header 'Authorization: Bearer <token>'import requests
url = "https://macaly.com/api/chat/{chatId}/deployment"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://macaly.com/api/chat/{chatId}/deployment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://macaly.com/api/chat/{chatId}/deployment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://macaly.com/api/chat/{chatId}/deployment"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://macaly.com/api/chat/{chatId}/deployment")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://macaly.com/api/chat/{chatId}/deployment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyEndpoints
Get deployment
Consulta el estado del intento de publicación más reciente de un chat
GET
/
api
/
chat
/
{chatId}
/
deployment
Get deployment
curl --request GET \
--url https://macaly.com/api/chat/{chatId}/deployment \
--header 'Authorization: Bearer <token>'import requests
url = "https://macaly.com/api/chat/{chatId}/deployment"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://macaly.com/api/chat/{chatId}/deployment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://macaly.com/api/chat/{chatId}/deployment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://macaly.com/api/chat/{chatId}/deployment"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://macaly.com/api/chat/{chatId}/deployment")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://macaly.com/api/chat/{chatId}/deployment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyConsulta el estado del intento de publicación más reciente de un chat, o del intento que indica
deploymentId. El intento más reciente puede estar aún compilándose, o puede haber fallado mientras una versión anterior sigue en vivo. Usa liveUrl para obtener la URL de la versión que está en vivo ahora. Si el despliegue no está en un estado final, este endpoint sincroniza el estado con Vercel antes de responder.
Solicitud
GET /api/chat/{chatId}/deployment
Encabezados
| Encabezado | Obligatorio | Descripción |
|---|---|---|
Authorization | Sí | Bearer macaly_... |
Parámetros de ruta
| Parámetro | Tipo | Descripción |
|---|---|---|
chatId | string | El ID del chat |
Parámetros de consulta
| Parámetro | Obligatorio | Descripción |
|---|---|---|
deploymentId | No | El id o deploymentId que devolvió POST /deploy. Sin él, el endpoint devuelve el intento de publicación más reciente del chat. |
Solicitud de ejemplo
curl "https://www.macaly.com/api/chat/abc123/deployment?deploymentId=jzga0sttml37v6mbizb8tk1x" \
-H "Authorization: Bearer macaly_abc123..."
const response = await fetch(
`https://www.macaly.com/api/chat/${chatId}/deployment?deploymentId=${deploymentId}`,
{
headers: {
'Authorization': 'Bearer macaly_abc123...',
},
}
);
const data = await response.json();
console.log(data.status, data.liveUrl);
import requests
response = requests.get(
f'https://www.macaly.com/api/chat/{chat_id}/deployment',
params={'deploymentId': deployment_id},
headers={
'Authorization': 'Bearer macaly_abc123...',
},
)
data = response.json()
print(data['status'], data['liveUrl'])
Respuesta
Despliegue listo
{
"id": "jzga0sttml37v6mbizb8tk1x",
"url": "https://macaly-staging-abc123.macaly.app",
"status": "READY",
"deploymentId": "dpl_HKLBd2QDTwq58AMUJiaMyUzk8WUw",
"createdAt": "2025-01-12T21:18:54.906Z",
"error": null,
"domain": "macaly-staging-abc123.macaly.app",
"domains": [
{
"domain": "macaly-staging-abc123.macaly.app",
"verified": true,
"isCustomDomain": false
}
],
"liveUrl": "https://macaly-staging-abc123.macaly.app"
}
Sin despliegue
{
"id": null,
"url": null,
"status": null,
"deploymentId": null,
"createdAt": null,
"error": null,
"domain": null,
"domains": [
{
"domain": "macaly-staging-abc123.macaly.app",
"verified": true,
"isCustomDomain": false
}
],
"liveUrl": null
}
Despliegue fallido
Una republicación fallida mantiene en vivo la versión anterior, así queliveUrl sigue definido.
{
"id": "jzga0sttml37v6mbizb8tk1x",
"url": "https://macaly-staging-abc123.macaly.app",
"status": "ERROR",
"deploymentId": "dpl_HKLBd2QDTwq58AMUJiaMyUzk8WUw",
"createdAt": "2025-01-12T21:18:54.906Z",
"error": ["Build failed: Module not found"],
"domain": "macaly-staging-abc123.macaly.app",
"domains": [],
"liveUrl": "https://macaly-staging-abc123.macaly.app"
}
Campos de respuesta
| Campo | Tipo | Descripción |
|---|---|---|
id | string | null | ID del despliegue en la base de datos (null si nunca se ha desplegado) |
url | string | null | La URL del despliegue |
status | string | null | Estado del despliegue en Vercel (ver a continuación) |
deploymentId | string | null | ID del despliegue en Vercel |
createdAt | string | null | Marca de tiempo ISO de creación del despliegue |
error | string[] | null | Mensajes de error si el despliegue ha fallado |
domain | string | null | Dominio principal del despliegue |
domains | array | Todos los dominios conectados |
domains[].domain | string | Nombre del dominio |
domains[].verified | boolean | Indica si el dominio está verificado |
domains[].isCustomDomain | boolean | Indica si es un dominio personalizado |
liveUrl | string | null | URL de la versión en vivo (null si no hay nada en vivo) |
Valores de estado del despliegue
| Estado | Descripción |
|---|---|
QUEUED | El despliegue está en cola |
BUILDING | La compilación está en curso |
READY | Despliegue correcto |
ERROR | El despliegue ha fallado |
CANCELED | El despliegue se canceló |
UNPUBLISHED | Retirado de producción |
Códigos de estado
| Código | Descripción |
|---|---|
| 200 | Correcto (si no existe ningún despliegue, devuelve campos nulos) |
| 401 | Clave API no válida o ausente |
| 403 | El chat no pertenece a tu equipo |
| 404 | Chat no encontrado, o deploymentId no coincide con ningún despliegue de este chat |
Patrón de sondeo
Pasa comodeploymentId el id que devolvió POST /deploy.
while true; do
DEPLOYMENT=$(curl -s "https://www.macaly.com/api/chat/$CHAT_ID/deployment?deploymentId=$DEPLOYMENT_ID" \
-H "Authorization: Bearer macaly_...")
STATUS=$(echo $DEPLOYMENT | jq -r '.status')
echo "Status: $STATUS"
if [[ $STATUS == "READY" ]]; then
echo "Deployed: $(echo $DEPLOYMENT | jq -r '.liveUrl')"
break
elif [[ $STATUS == "ERROR" ]]; then
echo "Failed: $(echo $DEPLOYMENT | jq -r '.error')"
break
fi
sleep 3
done
¿Esta página le ayudó?