Docs
Contact

YOU(th) API reference

Every route of the API: its scope, parameters, request body, answers, errors and samples, drawn from the API's OpenAPI description.

This page is drawn from the API's OpenAPI description, which is generated from the API's own routes, so it says what the API does. Hand that file to your own tools to generate a client or import the routes.

Get API credentials first, then get a token and send it with every request. A refused request answers a Problem document: Errors and rate limits says how to read one and when to try again.

The API partners' servers call, under /v1, with an OAuth access token their client credentials get.

  • Base URL: https://api.youth-platform.io
  • Token endpoint: https://auth.youth-platform.io/realms/youth/protocol/openid-connect/token
  • Version: 1

Organization

The organization an integration's credentials belong to, and the integration itself.

The organization the credentials belong to, and the integration calling

GET/v1/organization

Needs no particular scope, but the token must be requested with at least one granted scope, which gives it the API's audience: a partner calls it to check new credentials. The organization is the credentials', never the request's.

Any token of the API: no particular scope.

Responses

  • 200application/json CurrentOrganization
    The organization and the integration.
  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), or gave up (timed_out): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out

      Example: identity_unavailable

Request

curl https://api.youth-platform.io/v1/organization \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN"

Response

{  "organization": {    "alias": "example-clinic",    "name": "Example Clinic"  },  "integration": {    "id": "3f2b8c1e-9a47-4d65-b0e2-7c1a5d9e4f08",    "name": "Billing",    "scopes": [      "access_codes:read"    ]  }}

Access codes

Batches of access codes your organization orders, and the codes in them: each gives one person access to YOU(th), and names no one.

Order a batch of access codes

POST/v1/access-code-batches

Makes count codes for your organization and answers 201 once every one can be read and redeemed. When that can't be finished now, it answers 503 with Retry-After: send the same order again, with the same Idempotency-Key and body, and it goes on with the same batch, never a second one. Your organization's batches ordered in one day, from 00:00 UTC, hold at most its daily limit of codes together: 1,000 unless YOU(th) raised it, on request. A repeat that goes on with a batch isn't counted again. Requires an Idempotency-Key. Needs access_codes:write.

Scope: access_codes:write

Parameters

  • idempotency-keyheader · stringRequired
    A key of yours for the request, such as a UUID, at most 255 characters. The same key and body answer the first request again, and resume it after a 503, for 24 hours after the latest attempt.

    Example: 5f2b6f0e-3a51-4c58-9a57-2a1f6f1d3c11

Request body

application/json AccessCodeBatchOrder

Responses

  • 201application/json AccessCodeBatch
    The batch, ready, at the address in Location.
    Headers (1)
    • locationstringRequired
      Where the batch is read.

      Example: /v1/access-code-batches/0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21

  • 400application/problem+json Problem
    The body can't be parsed (malformed_request), the order has no Idempotency-Key (idempotency_key_required), or its key is empty or longer than 255 characters (idempotency_key_invalid).

    Codes: malformed_request idempotency_key_required idempotency_key_invalid

    Body fields (1)
    • codestringRequired

      One of malformed_request, idempotency_key_required, idempotency_key_invalid

      Example: malformed_request

  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 403application/problem+json Problem
    The token holds none of the OAuth scopes the route needs (insufficient_scope), and the header names them; or it holds a health scope whose Doctor's grant no longer counts, and the header names none.

    Codes: insufficient_scope

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      Always insufficient_scope

      Example: insufficient_scope

  • 409application/problem+json Problem
    The key was used with another body (idempotency_conflict): use a new key. An order with the key runs now (idempotency_in_progress, with Retry-After): send it again then. Your organization isn't in the app yet, so no code could be redeemed (app_not_set_up): ask YOU(th).

    Codes: idempotency_conflict idempotency_in_progress app_not_set_up

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of idempotency_conflict, idempotency_in_progress, app_not_set_up

      Example: idempotency_conflict

  • 413application/problem+json Problem
    The body is over the API's limit (too_large).

    Codes: too_large

    Body fields (1)
    • codestringRequired

      Always too_large

      Example: too_large

  • 415application/problem+json Problem
    The body isn't JSON (unsupported_media_type).

    Codes: unsupported_media_type

    Body fields (1)
    • codestringRequired

      Always unsupported_media_type

      Example: unsupported_media_type

  • 422application/problem+json Problem
    A field is missing, not valid or not one the order takes (invalid_request), redeem_by has passed (redeem_by_passed) or is more than five years ahead (redeem_by_too_far), or the order would take your organization past its daily limit (count_over_limit): nothing was made.

    Codes: invalid_request redeem_by_passed redeem_by_too_far count_over_limit

    Body fields (1)
    • codestringRequired

      One of invalid_request, redeem_by_passed, redeem_by_too_far, count_over_limit

      Example: invalid_request

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), gave up (timed_out), or can't finish the request now (temporarily_unavailable): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out temporarily_unavailable

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out, temporarily_unavailable

      Example: identity_unavailable

Request

curl --request POST https://api.youth-platform.io/v1/access-code-batches \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN" \  --header "idempotency-key: 5f2b6f0e-3a51-4c58-9a57-2a1f6f1d3c11" \  --header "Content-Type: application/json" \  --data '{  "count": 1000,  "label": "december-2026",  "redeem_by": "2027-12-31T23:59:59Z",  "access": {    "term": "until_ended"  }}'

Response

{  "id": "0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21",  "label": "december-2026",  "status": "ready",  "count": 1000,  "redeem_by": "2027-12-31T23:59:59.000Z",  "access": {    "term": "until_ended"  },  "created_at": "2026-12-01T10:00:00.000Z"}

Read a batch of access codes

GET/v1/access-code-batches/{batch_id}

One of your organization's batches. Needs access_codes:read or access_codes:write.

Scope: access_codes:read

Parameters

  • batch_idpath · stringRequired
    The batch's id.

    Format: uuid

    Example: 0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21

Responses

  • 200application/json AccessCodeBatch
    The batch.
  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 403application/problem+json Problem
    The token holds none of the OAuth scopes the route needs (insufficient_scope), and the header names them; or it holds a health scope whose Doctor's grant no longer counts, and the header names none.

    Codes: insufficient_scope

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      Always insufficient_scope

      Example: insufficient_scope

  • 404application/problem+json Problem
    No batch of yours has this id (not_found).

    Codes: not_found

    Body fields (1)
    • codestringRequired

      Always not_found

      Example: not_found

  • 422application/problem+json Problem
    A field is missing or not valid (invalid_request).

    Codes: invalid_request

    Body fields (1)
    • codestringRequired

      Always invalid_request

      Example: invalid_request

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), or gave up (timed_out): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out

      Example: identity_unavailable

Request

curl https://api.youth-platform.io/v1/access-code-batches/0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21 \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN"

Response

{  "id": "0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21",  "label": "december-2026",  "status": "ready",  "count": 1000,  "redeem_by": "2027-12-31T23:59:59.000Z",  "access": {    "term": "until_ended"  },  "created_at": "2026-12-01T10:00:00.000Z"}

List access codes

GET/v1/access-codes

Your organization's codes of batches that are ready, that the filters keep, in a stable order. As JSON, a page at a time: pass a page's next as after for the next one. With Accept: text/csv, one CSV file of every code the filters keep, not paged, up to 50,000 codes. Needs access_codes:read or access_codes:write.

Scope: access_codes:read

Parameters

  • batch_idquery · string
    The codes of one batch.

    Format: uuid

    Example: 0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21

  • statusquery · string
    The codes in one status.

    One of available, redeemed, ended, deactivated, expired

    Example: redeemed

  • redeemed_fromquery · string
    The codes redeemed at or after this time.

    Format: date-time

    Example: 2026-12-01T00:00:00Z

  • redeemed_toquery · string
    The codes redeemed before this time.

    Format: date-time

    Example: 2027-01-01T00:00:00Z

  • ended_fromquery · string
    The codes whose access ended at or after this time, and has ended by now: an end still ahead isn't kept.

    Format: date-time

    Example: 2026-12-12T08:30:00Z

  • afterquery · string
    The next page: the next of the page before. Not with Accept: text/csv.

    Format: uuid

    Example: 0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34

  • limitquery · integer
    How many codes a page holds, at most 1,000; 100 unless set. Not with Accept: text/csv.

    At least 1

    At most 1000

    Example: 100

Responses

  • 200application/json AccessCodePage or text/csv string
    A page of codes, or every one as CSV.

    text/csv: A header line, then one line per code: id, batch_id, code, redeem_url, status, redeemed_at, access_term, access_ends_at, each empty for none.

  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 403application/problem+json Problem
    The token holds none of the OAuth scopes the route needs (insufficient_scope), and the header names them; or it holds a health scope whose Doctor's grant no longer counts, and the header names none.

    Codes: insufficient_scope

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      Always insufficient_scope

      Example: insufficient_scope

  • 422application/problem+json Problem
    A field is missing or not valid (invalid_request), or a CSV file would hold more than 50,000 codes (too_many_codes): filter by batch_id or a time range, or read pages as JSON.

    Codes: invalid_request too_many_codes

    Body fields (1)
    • codestringRequired

      One of invalid_request, too_many_codes

      Example: invalid_request

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), or gave up (timed_out): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out

      Example: identity_unavailable

Request

curl https://api.youth-platform.io/v1/access-codes \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN"

Response

{  "items": [    {      "id": "0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34",      "batch_id": "0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21",      "code": "482957362845",      "redeem_url": "https://youthai.app.link/?~channel=partners&~feature=access_code&$partner_configuration_system_name=coopvoce&$access_code=482957362845",      "status": "available",      "redeemed_at": null,      "access": {        "term": "until_ended",        "ends_at": null      }    }  ],  "next": "0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34"}

Read an access code

GET/v1/access-codes/{access_code_id}

One of your organization's codes, with its redeem_url: the address an event's resource_url names. Needs access_codes:read or access_codes:write.

Scope: access_codes:read

Parameters

  • access_code_idpath · stringRequired
    The code's id.

    Format: uuid

    Example: 0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34

Responses

  • 200application/json AccessCode
    The code.
  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 403application/problem+json Problem
    The token holds none of the OAuth scopes the route needs (insufficient_scope), and the header names them; or it holds a health scope whose Doctor's grant no longer counts, and the header names none.

    Codes: insufficient_scope

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      Always insufficient_scope

      Example: insufficient_scope

  • 404application/problem+json Problem
    No code of yours has this id (not_found).

    Codes: not_found

    Body fields (1)
    • codestringRequired

      Always not_found

      Example: not_found

  • 422application/problem+json Problem
    A field is missing or not valid (invalid_request).

    Codes: invalid_request

    Body fields (1)
    • codestringRequired

      Always invalid_request

      Example: invalid_request

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), or gave up (timed_out): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out

      Example: identity_unavailable

Request

curl https://api.youth-platform.io/v1/access-codes/0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34 \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN"

Response

{  "id": "0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34",  "batch_id": "0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21",  "code": "482957362845",  "redeem_url": "https://youthai.app.link/?~channel=partners&~feature=access_code&$partner_configuration_system_name=coopvoce&$access_code=482957362845",  "status": "available",  "redeemed_at": null,  "access": {    "term": "until_ended",    "ends_at": null  }}

Block an access code

POST/v1/access-codes/{access_code_id}/deactivate

Blocks one of your organization's codes nobody redeemed, which then can never be redeemed, and answers it deactivated. Blocking it again changes nothing. A redeemed code is refused: end its access instead. Needs access_codes:write.

Scope: access_codes:write

Parameters

  • access_code_idpath · stringRequired
    The code's id.

    Format: uuid

    Example: 0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34

Responses

  • 200application/json AccessCode
    The code, deactivated.
  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 403application/problem+json Problem
    The token holds none of the OAuth scopes the route needs (insufficient_scope), and the header names them; or it holds a health scope whose Doctor's grant no longer counts, and the header names none.

    Codes: insufficient_scope

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      Always insufficient_scope

      Example: insufficient_scope

  • 404application/problem+json Problem
    No code of yours has this id (not_found).

    Codes: not_found

    Body fields (1)
    • codestringRequired

      Always not_found

      Example: not_found

  • 409application/problem+json Problem
    Someone redeemed the code (already_redeemed): end its access instead. Someone is redeeming it this moment (redemption_in_progress, with Retry-After): send it again then.

    Codes: already_redeemed redemption_in_progress

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of already_redeemed, redemption_in_progress

      Example: already_redeemed

  • 422application/problem+json Problem
    A field is missing or not valid (invalid_request).

    Codes: invalid_request

    Body fields (1)
    • codestringRequired

      Always invalid_request

      Example: invalid_request

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), gave up (timed_out), or can't finish the request now (temporarily_unavailable): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out temporarily_unavailable

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out, temporarily_unavailable

      Example: identity_unavailable

Request

curl --request POST https://api.youth-platform.io/v1/access-codes/0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34/deactivate \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN"

Response

{  "id": "0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34",  "batch_id": "0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21",  "code": "482957362845",  "redeem_url": "https://youthai.app.link/?~channel=partners&~feature=access_code&$partner_configuration_system_name=coopvoce&$access_code=482957362845",  "status": "available",  "redeemed_at": null,  "access": {    "term": "until_ended",    "ends_at": null  }}

End the access a code started

PUT/v1/access-codes/{access_code_id}/access

Sets when the access one of your organization's redeemed codes started ends, and answers the code. A time to come ends it then; one that has passed, or none sent, ends it now; null undoes an end that hasn't passed. The access stops in the YOU(th) app within about 10 minutes after its end, later when the app can't be reached then. The same call twice leaves the same end. An end that has passed is final: ending it again answers the code as it is. Needs access_codes:write.

Scope: access_codes:write

Parameters

  • access_code_idpath · stringRequired
    The code's id.

    Format: uuid

    Example: 0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34

Request body

application/json AccessEndChange

Responses

  • 200application/json AccessCode
    The code, with the end set.
  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 403application/problem+json Problem
    The token holds none of the OAuth scopes the route needs (insufficient_scope), and the header names them; or it holds a health scope whose Doctor's grant no longer counts, and the header names none.

    Codes: insufficient_scope

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      Always insufficient_scope

      Example: insufficient_scope

  • 404application/problem+json Problem
    No code of yours has this id (not_found).

    Codes: not_found

    Body fields (1)
    • codestringRequired

      Always not_found

      Example: not_found

  • 409application/problem+json Problem
    Nobody redeemed the code (not_redeemed): block it instead. Its access has ended, and the call asks for a later end or none (access_ended).

    Codes: not_redeemed access_ended

    Body fields (1)
    • codestringRequired

      One of not_redeemed, access_ended

      Example: not_redeemed

  • 413application/problem+json Problem
    The body is over the API's limit (too_large).

    Codes: too_large

    Body fields (1)
    • codestringRequired

      Always too_large

      Example: too_large

  • 415application/problem+json Problem
    The body isn't JSON (unsupported_media_type).

    Codes: unsupported_media_type

    Body fields (1)
    • codestringRequired

      Always unsupported_media_type

      Example: unsupported_media_type

  • 422application/problem+json Problem
    A field is missing, not valid or not one the call takes (invalid_request), or the end is later than a fixed_days code's own term (ends_at_beyond_term).

    Codes: invalid_request ends_at_beyond_term

    Body fields (1)
    • codestringRequired

      One of invalid_request, ends_at_beyond_term

      Example: invalid_request

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), gave up (timed_out), or can't finish the request now (temporarily_unavailable): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out temporarily_unavailable

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out, temporarily_unavailable

      Example: identity_unavailable

Request

curl --request PUT https://api.youth-platform.io/v1/access-codes/0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34/access \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN" \  --header "Content-Type: application/json" \  --data '{  "ends_at": "2027-01-12T00:00:00Z"}'

Response

{  "id": "0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34",  "batch_id": "0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21",  "code": "482957362845",  "redeem_url": "https://youthai.app.link/?~channel=partners&~feature=access_code&$partner_configuration_system_name=coopvoce&$access_code=482957362845",  "status": "available",  "redeemed_at": null,  "access": {    "term": "until_ended",    "ends_at": null  }}

Webhooks

Your organization's webhook endpoints: the HTTPS addresses YOU(th) sends signed events to, each with its own signing secret and the events it receives.

List your webhook endpoints

GET/v1/webhook-endpoints

Your organization's endpoints, oldest first, a page at a time: pass a page's next as after for the next. An after that isn't one of your endpoints is refused with 422 invalid_request. Needs webhooks:write: there is no read-only webhook scope.

Scope: webhooks:write

Parameters

  • afterquery · string
    The next of the page before; none for the first page.

    Format: uuid

    Example: 0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90

  • limitquery · integer
    How many endpoints a page holds, at most 100.

    At least 1

    At most 100

    Default: 50

    Example: 50

Responses

  • 200application/json WebhookEndpointPage
    A page of the endpoints.
  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 403application/problem+json Problem
    The token holds none of the OAuth scopes the route needs (insufficient_scope), and the header names them; or it holds a health scope whose Doctor's grant no longer counts, and the header names none.

    Codes: insufficient_scope

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      Always insufficient_scope

      Example: insufficient_scope

  • 422application/problem+json Problem
    A field is missing or not valid (invalid_request).

    Codes: invalid_request

    Body fields (1)
    • codestringRequired

      Always invalid_request

      Example: invalid_request

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), or gave up (timed_out): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out

      Example: identity_unavailable

Request

curl https://api.youth-platform.io/v1/webhook-endpoints \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN"

Response

{  "items": [    {      "id": "0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90",      "url": "https://partner.example.com/youth-webhook",      "description": "Billing",      "event_types": [        "Access.ended",        "AccessCode.redeemed"      ],      "status": "active",      "created_at": "2026-11-20T09:30:00.000Z",      "updated_at": "2026-11-20T09:30:00.000Z"    }  ],  "next": null}

Create a webhook endpoint

POST/v1/webhook-endpoints

Creates an endpoint of your organization's and answers 201 with it and its signing secret, the only answer that carries the secret. Send the same create again, with the same Idempotency-Key and body, and it answers the same endpoint and secret, never a second endpoint. Requires an Idempotency-Key. Needs webhooks:write.

Scope: webhooks:write

Parameters

  • idempotency-keyheader · stringRequired
    A key of yours for the request, such as a UUID, at most 255 characters. The same key and body answer the first request again, and resume it after a 503, for 24 hours after the latest attempt.

    Example: 5f2b6f0e-3a51-4c58-9a57-2a1f6f1d3c11

Request body

application/json WebhookEndpointRequest

Responses

  • 201application/json CreatedWebhookEndpoint
    The endpoint, with its signing secret, at the address in Location.
    Headers (1)
    • locationstringRequired
      Where the endpoint is read.

      Example: /v1/webhook-endpoints/0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90

  • 400application/problem+json Problem
    The body can't be parsed (malformed_request), the create has no Idempotency-Key (idempotency_key_required), or its key is empty or longer than 255 characters (idempotency_key_invalid).

    Codes: malformed_request idempotency_key_required idempotency_key_invalid

    Body fields (1)
    • codestringRequired

      One of malformed_request, idempotency_key_required, idempotency_key_invalid

      Example: malformed_request

  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 403application/problem+json Problem
    The token holds none of the OAuth scopes the route needs (insufficient_scope), and the header names them; or it holds a health scope whose Doctor's grant no longer counts, and the header names none.

    Codes: insufficient_scope

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      Always insufficient_scope

      Example: insufficient_scope

  • 409application/problem+json Problem
    The key was used with another body (idempotency_conflict): use a new key. A create with the key runs now (idempotency_in_progress, with Retry-After): send it again then. Your organization keeps ten endpoints already, disabled ones aside (endpoint_limit_reached): disable one first.

    Codes: idempotency_conflict idempotency_in_progress endpoint_limit_reached

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of idempotency_conflict, idempotency_in_progress, endpoint_limit_reached

      Example: idempotency_conflict

  • 413application/problem+json Problem
    The body is over the API's limit (too_large).

    Codes: too_large

    Body fields (1)
    • codestringRequired

      Always too_large

      Example: too_large

  • 415application/problem+json Problem
    The body isn't JSON (unsupported_media_type).

    Codes: unsupported_media_type

    Body fields (1)
    • codestringRequired

      Always unsupported_media_type

      Example: unsupported_media_type

  • 422application/problem+json Problem
    A field is missing, not valid or not one the create takes (invalid_request), the address isn't https on port 443 without credentials, or its host is localhost, a name of one label or an IP address that isn't public (url_not_allowed), or an event type isn't one YOU(th) sends (unknown_event_type).

    Codes: invalid_request url_not_allowed unknown_event_type

    Body fields (1)
    • codestringRequired

      One of invalid_request, url_not_allowed, unknown_event_type

      Example: invalid_request

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), gave up (timed_out), or can't finish the request now (temporarily_unavailable): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out temporarily_unavailable

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out, temporarily_unavailable

      Example: identity_unavailable

Request

curl --request POST https://api.youth-platform.io/v1/webhook-endpoints \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN" \  --header "idempotency-key: 5f2b6f0e-3a51-4c58-9a57-2a1f6f1d3c11" \  --header "Content-Type: application/json" \  --data '{  "url": "https://partner.example.com/youth-webhook",  "event_types": [    "AccessCode.redeemed",    "Access.ended"  ],  "description": "Billing"}'

Response

{  "id": "0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90",  "url": "https://partner.example.com/youth-webhook",  "description": "Billing",  "event_types": [    "Access.ended",    "AccessCode.redeemed"  ],  "status": "active",  "created_at": "2026-11-20T09:30:00.000Z",  "updated_at": "2026-11-20T09:30:00.000Z",  "signing_secret": "whsec_Zm9vYmFyYmF6cXV4LWV4YW1wbGUtc2VjcmV0LXZhbHVl"}

Read a webhook endpoint

GET/v1/webhook-endpoints/{webhook_endpoint_id}

One of your organization's endpoints, without its signing secret. Needs webhooks:write.

Scope: webhooks:write

Parameters

  • webhook_endpoint_idpath · stringRequired
    The endpoint's id.

    Format: uuid

    Example: 0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90

Responses

  • 200application/json WebhookEndpoint
    The endpoint.
  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 403application/problem+json Problem
    The token holds none of the OAuth scopes the route needs (insufficient_scope), and the header names them; or it holds a health scope whose Doctor's grant no longer counts, and the header names none.

    Codes: insufficient_scope

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      Always insufficient_scope

      Example: insufficient_scope

  • 404application/problem+json Problem
    No endpoint of yours has this id (not_found).

    Codes: not_found

    Body fields (1)
    • codestringRequired

      Always not_found

      Example: not_found

  • 422application/problem+json Problem
    A field is missing or not valid (invalid_request).

    Codes: invalid_request

    Body fields (1)
    • codestringRequired

      Always invalid_request

      Example: invalid_request

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), or gave up (timed_out): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out

      Example: identity_unavailable

Request

curl https://api.youth-platform.io/v1/webhook-endpoints/0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90 \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN"

Response

{  "id": "0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90",  "url": "https://partner.example.com/youth-webhook",  "description": "Billing",  "event_types": [    "Access.ended",    "AccessCode.redeemed"  ],  "status": "active",  "created_at": "2026-11-20T09:30:00.000Z",  "updated_at": "2026-11-20T09:30:00.000Z"}

Disable a webhook endpoint

POST/v1/webhook-endpoints/{webhook_endpoint_id}/disable

Stops deliveries to one of your organization's endpoints, active or paused: what it still had to receive fails at once, and you read it from the API. It can't be turned on again; create an endpoint for the address instead. Disabling it again answers it as it stands. Needs webhooks:write.

Scope: webhooks:write

Parameters

  • webhook_endpoint_idpath · stringRequired
    The endpoint's id.

    Format: uuid

    Example: 0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90

Responses

  • 200application/json WebhookEndpoint
    The endpoint, disabled.
  • 401application/problem+json Problem
    No bearer token, or one that doesn't hold, or whose client is unknown (invalid_token), or whose integration was revoked (integration_revoked).

    Codes: invalid_token integration_revoked

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      One of invalid_token, integration_revoked

      Example: invalid_token

  • 403application/problem+json Problem
    The token holds none of the OAuth scopes the route needs (insufficient_scope), and the header names them; or it holds a health scope whose Doctor's grant no longer counts, and the header names none.

    Codes: insufficient_scope

    Headers (1)
    • www-authenticatestringRequired
      What the caller must present: Bearer, alone when the request carried no bearer token, and with the error it was refused for when the token didn't hold.

      Example: Bearer error="invalid_token"

    Body fields (1)
    • codestringRequired

      Always insufficient_scope

      Example: insufficient_scope

  • 404application/problem+json Problem
    No endpoint of yours has this id (not_found).

    Codes: not_found

    Body fields (1)
    • codestringRequired

      Always not_found

      Example: not_found

  • 422application/problem+json Problem
    A field is missing or not valid (invalid_request).

    Codes: invalid_request

    Body fields (1)
    • codestringRequired

      Always invalid_request

      Example: invalid_request

  • 500application/problem+json Problem
    The API failed; the request id in the answer names the request (internal_error).

    Codes: internal_error

    Body fields (1)
    • codestringRequired

      Always internal_error

      Example: internal_error

  • 503application/problem+json Problem
    The API can't check the token now (identity_unavailable), or gave up (timed_out): send the same request again after Retry-After seconds.

    Codes: identity_unavailable timed_out

    Headers (1)
    • retry-afterstring
      In how many seconds to send the same request again.

      Example: 10

    Body fields (1)
    • codestringRequired

      One of identity_unavailable, timed_out

      Example: identity_unavailable

Request

curl --request POST https://api.youth-platform.io/v1/webhook-endpoints/0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90/disable \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN"

Response

{  "id": "0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90",  "url": "https://partner.example.com/youth-webhook",  "description": "Billing",  "event_types": [    "Access.ended",    "AccessCode.redeemed"  ],  "status": "active",  "created_at": "2026-11-20T09:30:00.000Z",  "updated_at": "2026-11-20T09:30:00.000Z"}

Schemas

AccessCodeRedeemed

  • event_idstringRequired

    Matches ^evt_[0-9a-f]{32}$

    Example: evt_3b9f2c1a7d4e4f6a8c5b0e1d2f3a4b5c

  • event_typestringRequired

    Always AccessCode.redeemed

    Example: AccessCode.redeemed

  • occurred_atstringRequired

    Format: date-time

    Example: 2026-12-12T09:30:00.375000Z

  • resource_urlstringRequired

    Format: uri

    Example: https://api.youth-platform.io/v1/access-codes/0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34

  • access_code_idstringRequired

    Format: uuid

    Example: 0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34

  • batch_idstringRequired

    Format: uuid

    Example: 0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21

AccessEnded

  • event_idstringRequired

    Matches ^evt_[0-9a-f]{32}$

    Example: evt_3b9f2c1a7d4e4f6a8c5b0e1d2f3a4b5c

  • event_typestringRequired

    Always Access.ended

    Example: Access.ended

  • occurred_atstringRequired

    Format: date-time

    Example: 2026-12-12T09:30:00.375000Z

  • resource_urlstringRequired

    Format: uri

    Example: https://api.youth-platform.io/v1/access-codes/0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34

  • access_code_idstringRequired

    Format: uuid

    Example: 0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34

  • batch_idstringRequired

    Format: uuid

    Example: 0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21

  • reasonstringRequired

    One of ended_by_partner, term_over

    Example: ended_by_partner

CurrentOrganization

The organization the credentials belong to, and the integration calling: what a partner reads to check new credentials.

  • organizationobjectRequired
    The organization the credentials belong to.
    Child fields (2)
    • organization.aliasstringRequired
      The organization's alias, which never changes.

      1 to 255 characters

      Example: example-clinic

    • organization.namestringRequired
      The organization's name.

      Example: Example Clinic

  • integrationobjectRequired
    The integration calling.
    Child fields (3)
    • integration.idstringRequired
      The integration's id.

      Example: 3f2b8c1e-9a47-4d65-b0e2-7c1a5d9e4f08

    • integration.namestringRequired
      The name its admins gave it.

      Example: Billing

    • integration.scopesarray of stringRequired
      The OAuth scopes the calling token holds, in the catalogue's order. Today: access_codes:read, access_codes:write, webhooks:write, checkups:read, patients:read. A scope added later appears here without a new version, so read each as text.

      Example: ["access_codes:read"]

Problem

  • typestringRequired
    Always about:blank: the status and code say what happened.

    Always about:blank

    Example: about:blank

  • titlestringRequired
    The status's English name, for logs; match on code instead.

    Example: Unauthorized

  • statusintegerRequired
    The HTTP status of the answer.

    Example: 401

  • codestringRequired
    What happened, stable and in snake_case; clients translate it. Codes can be added within v1, so a client treats a code it doesn't know by the HTTP status.

    Matches ^[a-z][a-z0-9_]*$

    Example: invalid_token

  • request_idstringRequired
    The request's id, as the logs name it.

    Example: 7f3c2a9e-5b1d-4c6a-9e0f-2d8b4a1c6e53

AccessCodeBatch

  • idstringRequired
    The batch's id: what its codes and the other routes name.

    Format: uuid

    Example: 0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21

  • labelstringRequired
    The name of yours the order gave it.

    Example: december-2026

  • statusstringRequired
    ready once every code can be read and redeemed, which an order answers with. creating while an order that answered 503 hasn't been sent again; failed when none was within a day, and then none of its codes is listed or billed.

    One of creating, ready, failed

    Example: ready

  • countintegerRequired
    How many codes it holds.

    Example: 1000

  • redeem_bystring or nullRequired
    The last moment one of its codes can be redeemed; none for no end.

    Format: date-time

    Example: 2027-12-31T23:59:59.000Z

  • What a redeemed code grants.

    Example: {"term":"until_ended"}

  • created_atstringRequired
    When it was ordered.

    Format: date-time

    Example: 2026-12-01T10:00:00.000Z

FixedDaysAccess

  • termstringRequired
    Access for days days from the redemption, which then ends by itself.

    Always fixed_days

    Example: fixed_days

  • daysintegerRequired
    How many days a redeemed code's access lasts.

    At least 1

    At most 3650

    Example: 30

UntilEndedAccess

  • termstringRequired
    Access until the organization ends it, for a service billed by period.

    Always until_ended

    Example: until_ended

AccessCodeBatchOrder

  • countintegerRequired
    How many codes, at most 20,000, and within your organization's daily limit: 1,000 codes a day unless YOU(th) raised it.

    At least 1

    At most 20000

    Example: 1000

  • labelstringRequired
    A name of yours for the batch, such as the month or your order number. It is never shown to a customer.

    1 to 100 characters

    Example: december-2026

  • redeem_bystring or null
    The last moment a code of the batch can be redeemed, still to come and at most five years ahead; none for no end.

    Format: date-time

    Example: 2027-12-31T23:59:59Z

  • What a redeemed code of the batch grants.

    Example: {"term":"until_ended"}

FixedDaysAccessOrder

  • termstringRequired
    Access for days days from the redemption, which then ends by itself.

    Always fixed_days

    Example: fixed_days

  • daysintegerRequired
    How many days a redeemed code's access lasts.

    At least 1

    At most 3650

    Example: 30

UntilEndedAccessOrder

  • termstringRequired
    Access until the organization ends it, for a service billed by period.

    Always until_ended

    Example: until_ended

AccessCodePage

  • itemsarray of AccessCodeRequired
    The page's codes, in order of their ids.

    Example: [{"id":"0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34","batch_id":"0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21","code":"482957362845","redeem_url":"https://youthai.app.link/?~channel=partners&~feature=access_code&$partner_configuration_system_name=coopvoce&$access_code=482957362845","status":"available","redeemed_at":null,"access":{"term":"until_ended","ends_at":null}}]

  • nextstring or nullRequired
    Pass it as after to read the next page; none on the last.

    Format: uuid

    Example: 0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34

AccessCode

  • idstringRequired
    The code's id: what events and the other routes name. Store it beside the code.

    Format: uuid

    Example: 0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34

  • batch_idstringRequired
    Its batch's id.

    Format: uuid

    Example: 0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21

  • codestringRequired
    What the customer types. An opaque string: store and show it exactly as it is, without spaces. A secret until redeemed.

    Example: 482957362845

  • redeem_urlstring or nullRequired
    The link that redeems it in the YOU(th) app, with your organization and the code filled in: use it exactly as it is. Absent (null) when your organization's members redeem in an app of its own.

    Format: uri

    Example: https://youthai.app.link/?~channel=partners&~feature=access_code&$partner_configuration_system_name=coopvoce&$access_code=482957362845

  • statusstringRequired
    available until someone redeems it, then redeemed, then ended once its access has stopped; or deactivated once you block it, or expired past its batch's redeem_by.

    One of available, redeemed, ended, deactivated, expired

    Example: available

  • redeemed_atstring or nullRequired
    When it was redeemed; none until it is.

    Format: date-time

    Example: null

  • accessobjectRequired
    The access it grants, once redeemed.
    Child fields (2)
    • access.termstringRequired
      Its batch's term.

      One of fixed_days, until_ended

      Example: until_ended

    • access.ends_atstring or nullRequired
      When its access ends or ended: the end you set, or a fixed_days code's last day once redeemed; none while no end is set.

      Format: date-time

      Example: null

AccessEndChange

  • ends_atstring or null
    When the access ends. A time to come ends it then; one that has passed, or none sent, ends it now; null undoes an end that hasn't passed, back to the code's own term.

    Format: date-time

    Example: 2027-01-12T00:00:00Z

CreatedWebhookEndpoint

Type: WebhookEndpoint

  • signing_secretstringRequired
    What your receiver verifies each delivery with: whsec_ and its key. Only the create answers it, and a repeat of the create with the same Idempotency-Key within 24 hours; store it in your secret store at once.

    Example: whsec_Zm9vYmFyYmF6cXV4LWV4YW1wbGUtc2VjcmV0LXZhbHVl

WebhookEndpoint

  • idstringRequired
    The endpoint's id.

    Format: uuid

    Example: 0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90

  • urlstringRequired
    Where its deliveries go.

    Example: https://partner.example.com/youth-webhook

  • descriptionstring or nullRequired
    Your note about it; none if you gave none.

    Example: Billing

  • event_typesarray of stringRequired
    The events it receives, in alphabetical order.

    Example: ["Access.ended","AccessCode.redeemed"]

  • statusstringRequired
    active: deliveries are sent. paused: YOU(th) stopped sending, because the address kept answering 404 or 410. disabled: you stopped it.

    One of active, paused, disabled

    Example: active

  • created_atstringRequired
    When it was created, in UTC.

    Format: date-time

    Example: 2026-11-20T09:30:00.000Z

  • updated_atstringRequired
    When it last changed, in UTC.

    Format: date-time

    Example: 2026-11-20T09:30:00.000Z

WebhookEndpointRequest

  • urlstringRequired
    Where deliveries go: an https address on port 443, without credentials, whose host resolves to public addresses when each delivery is sent.

    At most 2048 characters

    Example: https://partner.example.com/youth-webhook

  • event_typesarray of stringRequired
    The events it receives, by event_type; each named once is enough.

    1 to 20 items

    Each item: 1 to 100 characters

    Example: ["AccessCode.redeemed","Access.ended"]

  • descriptionstring
    A note of yours about it, such as the system it feeds.

    1 to 200 characters

    Example: Billing

WebhookEndpointPage

  • itemsarray of WebhookEndpointRequired
    The page's endpoints, oldest first.

    Example: [{"id":"0193b1d2-6f10-7a3e-9c41-2b8e7d5f4a90","url":"https://partner.example.com/youth-webhook","description":"Billing","event_types":["Access.ended","AccessCode.redeemed"],"status":"active","created_at":"2026-11-20T09:30:00.000Z","updated_at":"2026-11-20T09:30:00.000Z"}]

  • nextstring or nullRequired
    Pass as after for the next page; none after the last.

    Format: uuid

    Example: null

Errors

Scopes

Events

AccessCode.redeemed

AccessCode.redeemed

A code of your organization's was redeemed. occurred_at is the redemption: the time to bill from.

Payload

application/json AccessCodeRedeemed

{  "event_id": "evt_3b9f2c1a7d4e4f6a8c5b0e1d2f3a4b5c",  "event_type": "AccessCode.redeemed",  "occurred_at": "2026-12-12T09:30:00.375000Z",  "resource_url": "https://api.youth-platform.io/v1/access-codes/0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34",  "access_code_id": "0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34",  "batch_id": "0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21"}

Access.ended

Access.ended

The access a code started ended: the end you set passed (ended_by_partner), or a fixed_days code reached its last day (term_over). occurred_at is when it ended. New reasons can appear.

Payload

application/json AccessEnded

{  "event_id": "evt_3b9f2c1a7d4e4f6a8c5b0e1d2f3a4b5c",  "event_type": "Access.ended",  "occurred_at": "2026-12-12T09:30:00.375000Z",  "resource_url": "https://api.youth-platform.io/v1/access-codes/0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34",  "access_code_id": "0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34",  "batch_id": "0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21",  "reason": "ended_by_partner"}

Last updated