Saltar al contenido

Record a standing partner grant

Módulo Platform

POST/partner-standing-grants/recordpartnerStandingGrants.record

The client Owner (org.support_session.grant) records a grant the partner and client agreement provides (app.record_standing_grant): one read capability a support session may grant, an expiry within a year and the clause. A scope outside those, an expiry past a year and an org without a partner answer 422. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.

  • Requiere la capacidad org.support_session.grant.
  • Alcances de OAuth: org.
  • Envía el encabezado Idempotency-Key. Una repetición con la misma clave devuelve la respuesta original.
  • Estados de error: 400, 401, 409, 422, 429. Los errores son detalles de problema RFC 9457.

Cuerpo de la solicitud: PartnerStandingGrantRecordRequest

partnerStandingGrants.record: PartnerStandingGrantRecordRequest
CampoTipoObligatorioDescripción
capability_codestringSíThe read capability the grant covers.Restricciones: pattern ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$
valid_tostring (date-time)SíWhen the grant ends, within a year.
agreement_referencestringSíThe clause of the agreement.Restricciones: length 1 to 300
{
  "capability_code": "org.settings.read",
  "valid_to": "2026-10-08T14:30:00Z",
  "agreement_reference": "Partner agreement, clause 7.2"
}

Respuesta 201: PartnerStandingGrant

partnerStandingGrants.record: PartnerStandingGrant
CampoTipoObligatorioDescripción
idstring (uuid)SíIdentifier of the partner standing grant.
org_idstring (uuid)SíIdentifier of the owning organization, derived from the parent row and never accepted from the caller.
created_atstring (date-time)SíWhen the row was created.
created_bystring (uuid) | nullSíIdentifier of the person who created the row.
updated_atstring (date-time)SíWhen the row was last updated.
updated_bystring (uuid) | nullSíIdentifier of the person who last updated the row.
partner_org_idstring (uuid)SíIdentifier of the partner org whose staff may read.
capability_codestringSíThe scope: one read capability a support session may grant.Restricciones: pattern ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$
agreement_referencestringSíThe clause of the agreement that provides the grant.Restricciones: length 1 to 300
valid_fromstring (date-time)SíWhen access began.
valid_tostring (date-time)SíWhen access ends on its own.
record_grant_idstring (uuid)SíIdentifier of the org-level record grant the standing grant issued.
ended_atstring (date-time) | nullSíWhen someone ended the grant early.
ended_bystring (uuid) | nullSíIdentifier of the person who ended it early.
{
  "id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
  "org_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
  "created_at": "2026-10-08T14:30:00Z",
  "created_by": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
  "updated_at": "2026-10-08T14:30:00Z",
  "updated_by": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
  "partner_org_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
  "capability_code": "org.settings.read",
  "agreement_reference": "Partner agreement, clause 7.2",
  "valid_from": "2026-10-08T14:30:00Z",
  "valid_to": "2026-10-08T14:30:00Z",
  "record_grant_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
  "ended_at": "2026-10-08T14:30:00Z",
  "ended_by": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}

Ejemplos de código

curl -X POST "$XOS_BASE_URL/partner-standing-grants/record" \
  -H "Authorization: Bearer $XOS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"capability_code":"org.settings.read","valid_to":"2026-10-08T14:30:00Z","agreement_reference":"Partner agreement, clause 7.2"}'
const { data } = await xos.partnerStandingGrants.record({
    "capability_code": "org.settings.read",
    "valid_to": "2026-10-08T14:30:00Z",
    "agreement_reference": "Partner agreement, clause 7.2"
  });
response = xos.partner_standing_grants.record({"capability_code": "org.settings.read", "valid_to": "2026-10-08T14:30:00Z", "agreement_reference": "Partner agreement, clause 7.2"})
xos partner-standing-grants record --data '{"capability_code":"org.settings.read","valid_to":"2026-10-08T14:30:00Z","agreement_reference":"Partner agreement, clause 7.2"}'