API docs
Book a demo

Content Enrichment API / Approval Links

Revoke approval link

Page

POST /v2/project/content/revokeApprovalLink

Revoke one hotel's approval link by stamping RevokedAt, and change nothing else. The token stops resolving immediately — the public approval endpoints answer the same 404 they give an unknown token — rotateApprovalLink answers 404, and a hotel that had not approved leaves listApprovals. The hotel's approval survives: status, approval timestamps, approver, contacts and feedback are all kept, and exportApprovedHotelText keeps working. Call createApprovalLinks to mint a fresh link for the hotel afterwards. Repeating the call is safe: the row comes back with its original RevokedAt.

Example request

curl -X POST 'https://api.ygo.ai/v2/project/content/revokeApprovalLink' \
  -H "Authorization: Bearer $YGO_API_KEY" \
  -H "X-Project-ID: $YGO_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "HotelID": "019d9c2e-0ef8-7458-b0fa-8bed7182eb30"
}'

Authorization

Authorization: Bearer <key>

Project-scoped API key

Headers

  • X-Project-ID string (uuid) required

    Project UUID. Required for all project-scoped endpoints.

    Example
    $YGO_PROJECT_ID

Request body required

application/json object RevokeApprovalLinkRequest

The hotel whose link should be revoked.

  • HotelID string (uuid) required

    UUID of the hotel. Required, a valid non-nil UUID, and a live member of the calling project.

    Example
    019d9c2e-0ef8-7458-b0fa-8bed7182eb30
Example request: Revoke one hotel's link
{
  "HotelID": "019d9c2e-0ef8-7458-b0fa-8bed7182eb30"
}
Example request: Revoke again — the same request is safe
{
  "HotelID": "019d9c2e-0ef8-7458-b0fa-8bed7182eb30"
}

Responses

200 OK

The revoked link. RevokedAt is set and Token is never returned.

Headers

  • X-Trace-ID string

    Request trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.

    Example
    abc123def456ghi789

Body

application/json object RevokeApprovalLinkResponse

Single-object response envelope wrapping the revoked link.

  • Data object ApprovalLink required

    One hotel's approval link and its state. The same shape is returned by createApprovalLinks, rotateApprovalLink, revokeApprovalLink and listApprovals. NOTE: this response never carries the full Token — the revoked token is dead and resolves nothing. Use TokenPreview for display; createApprovalLinks returns a full token again once it mints a fresh link.

    15 fields
    • HotelID string (uuid) required

      UUID of the hotel this link belongs to.

      Example
      019d9c2e-0ef8-7458-b0fa-8bed7182eb30
    • HotelName string required

      Display name of the hotel.

      Example
      Sotavento Beach Club
    • GiataID integer

      The hotel's GIATA id. Omitted when the hotel has none.

      Example
      5721
    • MasterCode string

      The calling project's master code for this hotel. Omitted when the project has no code for it.

      Example
      FUED0009
    • TokenPreview string required

      Display form of the token: its first 8 characters followed by an ellipsis. Never enough to reconstruct the link.

      Example
      xPBOjXHo...
    • Status string required

      Approval state of this hotel's link, unchanged by the revoke. waiting_for_hotel on creation; any feedback moves it to feedback_received; feedback_applied is set once the feedback has been worked in; approved is never left by a later feedback submission; the one way back to waiting_for_hotel is a re-minted link (createApprovalLinks after a revoke), which keeps ApprovedAt, ApprovedTextGeneratedAt and ApprovedBy as the record of the earlier approval.

      Values
      waiting_for_hotel feedback_received feedback_applied approved
      Example
      approved
    • ApprovedAt string (date-time)

      When the hotel approved (RFC3339). Present once the hotel has ever approved: it is the RECORD of that approval and survives a later revoke and a re-minted link, so it can accompany a waiting_for_hotel Status (see createApprovalLinks). Only a fresh approval replaces it.

      Example
      2026-08-25T18:19:18.860882Z
    • ApprovedTextGeneratedAt string (date-time)

      Newest generation timestamp across the texts that were approved (RFC3339). Compare it with the hotel's current texts to see whether they changed since the approval. Present once the hotel has ever approved (it survives a revoke and a re-minted link, like ApprovedAt), and omitted then if none of the approved texts carried a timestamp.

      Example
      2026-08-19T14:14:57.674681Z
    • ApprovedBy object ApprovalApprover

      Present once the hotel has ever approved: the record of who signed off, kept across a later revoke and a re-minted link (so it can accompany a waiting_for_hotel Status) and replaced only by a fresh approval. The identity is the SNAPSHOT taken at approval time and survives deletion of the contact record (approved_by is ON DELETE SET NULL; the snapshot columns are not cleared).

      3 fields
      • Name string required

        The contact's name.

        Example
        Ayşe Yılmaz
      • Email string (email)

        The contact's email address.

        Example
        ayse@sotavento.example
      • Phone string

        The contact's phone number. Omitted when the contact did not supply one.

        Example
        +34 928 000 000
    • LastOpenedAt string (date-time)

      When the approval page was last loaded (RFC3339). Omitted while the link has never been opened.

      Example
      2026-08-25T18:19:18.966928Z
    • RevokedAt string (date-time) required

      When the link was revoked (RFC3339). Always present on this response, and set to the FIRST revoke's timestamp when the link was already revoked. A link carrying it never carries a Token.

      Example
      2026-08-25T18:19:19.602402Z
    • Created boolean required

      true only when this call minted the link. Always false on revokeApprovalLink, rotateApprovalLink and listApprovals.

      Example
      false
    • CreatedBy string

      Audit identity of who minted the link: a user token records the user's email; a project API key records its project-scoped identity (project:<project-uuid>). That is what is STORED; what is RETURNED is gated. The stored identity is an operator identity by construction, so in practice it carries an internal staff email — a contact route, and therefore contact PII on the same footing as ApprovedBy.Email and ApprovedBy.Phone: it is returned only to a caller presenting a user_ token, and is omitted entirely for a proj_ project token (the key is absent, not an empty string).

      Example
      editor@example.com
    • CreatedAt string (date-time) required

      When the link was minted (RFC3339).

      Example
      2026-08-25T18:19:17.522006Z
    • UpdatedAt string (date-time) required

      When the link last changed (RFC3339) — a status transition, an approval, a token rotation, or the revoke.

      Example
      2026-08-25T18:19:19.602402Z
Example response: Revoked link of an already approved hotel
{
  "Data": {
    "HotelID": "019d9c2e-0ef8-7458-b0fa-8bed7182eb30",
    "HotelName": "Sotavento Beach Club",
    "GiataID": 5721,
    "MasterCode": "FUED0009",
    "TokenPreview": "xPBOjXHo...",
    "Status": "approved",
    "ApprovedAt": "2026-08-25T18:19:18.860882Z",
    "ApprovedTextGeneratedAt": "2026-08-19T14:14:57.674681Z",
    "ApprovedBy": {
      "Name": "Ayşe Yılmaz",
      "Email": "ayse@sotavento.example",
      "Phone": "+34 928 000 000"
    },
    "LastOpenedAt": "2026-08-25T18:19:18.966928Z",
    "RevokedAt": "2026-08-25T18:19:19.602402Z",
    "Created": false,
    "CreatedBy": "editor@example.com",
    "CreatedAt": "2026-08-25T18:19:17.522006Z",
    "UpdatedAt": "2026-08-25T18:19:19.602402Z"
  }
}
Example response: Second revoke: the original RevokedAt is kept
{
  "Data": {
    "HotelID": "019d9c2e-0ef8-7458-b0fa-8bed7182eb30",
    "HotelName": "Sotavento Beach Club",
    "GiataID": 5721,
    "MasterCode": "FUED0009",
    "TokenPreview": "xPBOjXHo...",
    "Status": "approved",
    "ApprovedAt": "2026-08-25T18:19:18.860882Z",
    "ApprovedTextGeneratedAt": "2026-08-19T14:14:57.674681Z",
    "ApprovedBy": {
      "Name": "Ayşe Yılmaz",
      "Email": "ayse@sotavento.example",
      "Phone": "+34 928 000 000"
    },
    "LastOpenedAt": "2026-08-25T18:19:18.966928Z",
    "RevokedAt": "2026-08-25T18:19:19.602402Z",
    "Created": false,
    "CreatedBy": "editor@example.com",
    "CreatedAt": "2026-08-25T18:19:17.522006Z",
    "UpdatedAt": "2026-08-25T18:19:19.602402Z"
  }
}
400 Bad Request

Bad Request - the request body or the X-Project-ID header failed validation.

Headers

  • X-Trace-ID string

    Request trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.

    Example
    abc123def456ghi789

Body

application/json object ErrorResponse

Standard v2 error response wrapper.

  • Error object ErrorDetail required

    Error detail containing a machine-readable code and human-readable message.

    3 fields
    • Code string required

      Machine-readable error code for programmatic handling.

      Example
      VALIDATION_ERROR
    • Message string required

      Human-readable error message.

      Example
      Validation failed
    • Fields array of object FieldError

      Field-level validation errors. Only present for VALIDATION_ERROR responses.

      Each item

      A single field-level validation error.

      4 fields
      • Field string required

        Path of the field that failed validation, as the request sends it: a dotted path for a field inside a nested request object, a bare name for a top-level one.

        Example
        Name
      • Message string required

        Human-readable validation error message for this field.

        Example
        Name is required
      • Code string

        Machine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.

        Values
        REQUIRED TOO_LONG TOO_SHORT OUT_OF_RANGE TOO_MANY INVALID_FORMAT NOT_ALLOWED CONFLICT INVALID_ENCODING INSECURE_SCHEME UNSAFE_CONTENT REQUIRED_WHEN_ENABLED
        Example
        TOO_LONG
      • Params map of string to any

        Machine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.

        Example
        {
          "Max": 200
        }
Example response: X-Project-ID header missing
{
  "Error": {
    "Code": "VALIDATION_ERROR",
    "Message": "X-Project-ID header is required"
  }
}
Example response: Malformed request body
{
  "Error": {
    "Code": "VALIDATION_ERROR",
    "Message": "Invalid request body"
  }
}
Example response: HotelID missing or not a valid UUID
{
  "Error": {
    "Code": "VALIDATION_ERROR",
    "Message": "Validation failed",
    "Fields": [
      {
        "Field": "HotelID",
        "Message": "HotelID must be a valid UUID"
      }
    ]
  }
}
401 Unauthorized

Unauthorized - Invalid or missing bearer token.

Headers

  • X-Trace-ID string

    Request trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.

    Example
    abc123def456ghi789

Body

application/json object ErrorResponse

Standard v2 error response wrapper.

  • Error object ErrorDetail required

    Error detail containing a machine-readable code and human-readable message.

    3 fields
    • Code string required

      Machine-readable error code for programmatic handling.

      Example
      VALIDATION_ERROR
    • Message string required

      Human-readable error message.

      Example
      Validation failed
    • Fields array of object FieldError

      Field-level validation errors. Only present for VALIDATION_ERROR responses.

      Each item

      A single field-level validation error.

      4 fields
      • Field string required

        Path of the field that failed validation, as the request sends it: a dotted path for a field inside a nested request object, a bare name for a top-level one.

        Example
        Name
      • Message string required

        Human-readable validation error message for this field.

        Example
        Name is required
      • Code string

        Machine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.

        Values
        REQUIRED TOO_LONG TOO_SHORT OUT_OF_RANGE TOO_MANY INVALID_FORMAT NOT_ALLOWED CONFLICT INVALID_ENCODING INSECURE_SCHEME UNSAFE_CONTENT REQUIRED_WHEN_ENABLED
        Example
        TOO_LONG
      • Params map of string to any

        Machine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.

        Example
        {
          "Max": 200
        }
Example response: No Authorization header
{
  "Error": {
    "Code": "UNAUTHORIZED",
    "Message": "Missing bearer token"
  }
}
Example response: The bearer token is not valid
{
  "Error": {
    "Code": "UNAUTHORIZED",
    "Message": "Invalid bearer token"
  }
}
403 Forbidden

Forbidden - the caller is authenticated but may not act on this project. Also returned with code INSUFFICIENT_SCOPE when the API key does not carry the content.authoring:write permission this endpoint requires.

Headers

  • X-Trace-ID string

    Request trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.

    Example
    abc123def456ghi789

Body

application/json object ErrorResponse

Standard v2 error response wrapper.

  • Error object ErrorDetail required

    Error detail containing a machine-readable code and human-readable message.

    3 fields
    • Code string required

      Machine-readable error code for programmatic handling.

      Example
      VALIDATION_ERROR
    • Message string required

      Human-readable error message.

      Example
      Validation failed
    • Fields array of object FieldError

      Field-level validation errors. Only present for VALIDATION_ERROR responses.

      Each item

      A single field-level validation error.

      4 fields
      • Field string required

        Path of the field that failed validation, as the request sends it: a dotted path for a field inside a nested request object, a bare name for a top-level one.

        Example
        Name
      • Message string required

        Human-readable validation error message for this field.

        Example
        Name is required
      • Code string

        Machine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.

        Values
        REQUIRED TOO_LONG TOO_SHORT OUT_OF_RANGE TOO_MANY INVALID_FORMAT NOT_ALLOWED CONFLICT INVALID_ENCODING INSECURE_SCHEME UNSAFE_CONTENT REQUIRED_WHEN_ENABLED
        Example
        TOO_LONG
      • Params map of string to any

        Machine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.

        Example
        {
          "Max": 200
        }
Example response: Missing required scope
{
  "Error": {
    "Code": "INSUFFICIENT_SCOPE",
    "Message": "token lacks scope content.authoring:write"
  }
}
Example response: The user token has no editor access to the project
{
  "Error": {
    "Code": "FORBIDDEN",
    "Message": "Access denied to project"
  }
}
Example response: The request carries no project scope
{
  "Error": {
    "Code": "FORBIDDEN",
    "Message": "Project access required"
  }
}
404 Not Found

Not Found - the project or the hotel is not reachable for this caller.

Headers

  • X-Trace-ID string

    Request trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.

    Example
    abc123def456ghi789

Body

application/json object ErrorResponse

Standard v2 error response wrapper.

  • Error object ErrorDetail required

    Error detail containing a machine-readable code and human-readable message.

    3 fields
    • Code string required

      Machine-readable error code for programmatic handling.

      Example
      VALIDATION_ERROR
    • Message string required

      Human-readable error message.

      Example
      Validation failed
    • Fields array of object FieldError

      Field-level validation errors. Only present for VALIDATION_ERROR responses.

      Each item

      A single field-level validation error.

      4 fields
      • Field string required

        Path of the field that failed validation, as the request sends it: a dotted path for a field inside a nested request object, a bare name for a top-level one.

        Example
        Name
      • Message string required

        Human-readable validation error message for this field.

        Example
        Name is required
      • Code string

        Machine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.

        Values
        REQUIRED TOO_LONG TOO_SHORT OUT_OF_RANGE TOO_MANY INVALID_FORMAT NOT_ALLOWED CONFLICT INVALID_ENCODING INSECURE_SCHEME UNSAFE_CONTENT REQUIRED_WHEN_ENABLED
        Example
        TOO_LONG
      • Params map of string to any

        Machine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.

        Example
        {
          "Max": 200
        }
Example response: The project does not exist or was deleted (user tokens)
{
  "Error": {
    "Code": "NOT_FOUND",
    "Message": "Project not found"
  }
}
Example response: The hotel is not a live member of the project
{
  "Error": {
    "Code": "NOT_FOUND",
    "Message": "Hotel not found"
  }
}
Example response: The hotel is a member but has no link to revoke
{
  "Error": {
    "Code": "NOT_FOUND",
    "Message": "Approval link not found"
  }
}
429 Too Many Requests

Too Many Requests. The response includes a Retry-After header with the number of seconds to wait before retrying.

Headers

  • X-Trace-ID string

    Request trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.

    Example
    abc123def456ghi789
  • Retry-After integer

    Number of seconds to wait before retrying the request. Present on 429 responses.

    Example
    39
    Limits
    min 1

Body

application/json object ErrorResponse

Standard v2 error response wrapper.

  • Error object ErrorDetail required

    Error detail containing a machine-readable code and human-readable message.

    3 fields
    • Code string required

      Machine-readable error code for programmatic handling.

      Example
      VALIDATION_ERROR
    • Message string required

      Human-readable error message.

      Example
      Validation failed
    • Fields array of object FieldError

      Field-level validation errors. Only present for VALIDATION_ERROR responses.

      Each item

      A single field-level validation error.

      4 fields
      • Field string required

        Path of the field that failed validation, as the request sends it: a dotted path for a field inside a nested request object, a bare name for a top-level one.

        Example
        Name
      • Message string required

        Human-readable validation error message for this field.

        Example
        Name is required
      • Code string

        Machine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.

        Values
        REQUIRED TOO_LONG TOO_SHORT OUT_OF_RANGE TOO_MANY INVALID_FORMAT NOT_ALLOWED CONFLICT INVALID_ENCODING INSECURE_SCHEME UNSAFE_CONTENT REQUIRED_WHEN_ENABLED
        Example
        TOO_LONG
      • Params map of string to any

        Machine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.

        Example
        {
          "Max": 200
        }
Example response: Limit exceeded
{
  "Error": {
    "Code": "RATE_LIMIT_EXCEEDED",
    "Message": "Rate limit exceeded. Retry after the number of seconds in the Retry-After header."
  }
}
500 Internal Server Error

Internal Server Error - Unexpected server error. Include the X-Trace-ID header value when contacting support.

Headers

  • X-Trace-ID string

    Request trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.

    Example
    abc123def456ghi789

Body

application/json object ErrorResponse

Standard v2 error response wrapper.

  • Error object ErrorDetail required

    Error detail containing a machine-readable code and human-readable message.

    3 fields
    • Code string required

      Machine-readable error code for programmatic handling.

      Example
      VALIDATION_ERROR
    • Message string required

      Human-readable error message.

      Example
      Validation failed
    • Fields array of object FieldError

      Field-level validation errors. Only present for VALIDATION_ERROR responses.

      Each item

      A single field-level validation error.

      4 fields
      • Field string required

        Path of the field that failed validation, as the request sends it: a dotted path for a field inside a nested request object, a bare name for a top-level one.

        Example
        Name
      • Message string required

        Human-readable validation error message for this field.

        Example
        Name is required
      • Code string

        Machine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.

        Values
        REQUIRED TOO_LONG TOO_SHORT OUT_OF_RANGE TOO_MANY INVALID_FORMAT NOT_ALLOWED CONFLICT INVALID_ENCODING INSECURE_SCHEME UNSAFE_CONTENT REQUIRED_WHEN_ENABLED
        Example
        TOO_LONG
      • Params map of string to any

        Machine-readable values the message is built from, such as limits or allowed values. Keys are PascalCase; which keys are present depends on Code. Optional.

        Example
        {
          "Max": 200
        }
Example response: The link could not be revoked
{
  "Error": {
    "Code": "INTERNAL_ERROR",
    "Message": "Failed to revoke approval link"
  }
}
Example response: Hotel membership could not be verified
{
  "Error": {
    "Code": "INTERNAL_ERROR",
    "Message": "Failed to verify hotel"
  }
}