Documentation

esc
    API reference · Functions / Functions

    Functions

    Code that runs on each request to its own URL, billed per request and run time.

    Code that runs on each request to its own HTTPS URL, on a schedule, or when you invoke it; see the serverless functions guide for handlers, limits and pricing. Create a function, then deploy a version of its code; each deploy is a new numbered version, and you can switch back to an earlier one with activate. A function with auth set to key is called with one of its keys. Every change returns an operation to follow.

    List functions

    Your organization's functions, each with the URL it answers on.

    GET/public/v1/functions
    Read keyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    Response 200

    Functions.
    • dataarray of Functionrequired
      Show 10 child fields
      • idstringrequired

        The function's id, starting fn_.

      • namestringrequired

        The function's name.

      • zone_idstringrequired

        The zone it runs in.

      • urlstringrequired

        Where it answers: https://<random>.fn.pantechdynamics.com.

      • authstringrequired

        key: callers send one of its keys. public: anyone with the URL.

        One of key, public.

      • max_concurrencyintegerrequired

        The most requests it serves at once.

      • latest_versionintegerrequired

        The newest version's number; 0 before the first deploy.

      • active_versionintegerrequired

        The version serving; 0 until a build first succeeds.

      • statestringrequired

        active, or deleted once deleted.

        One of active, deleted.

      • created_atstringrequired

        When it was created.

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    curl "https://api.pantechdynamics.com/public/v1/functions" \
      -H "Authorization: Bearer $PANTECH_API_KEY"
    Response 200
    {
      "data": [
        {
          "id": "id",
          "name": "web-1",
          "zone_id": "af-abj-2",
          "url": "https://x.serial-console.pantechdynamics.com/…",
          "auth": "key",
          "max_concurrency": 1,
          "latest_version": 1,
          "active_version": 1,
          "state": "active",
          "created_at": "2026-10-03T09:30:00Z"
        }
      ]
    }

    Create a function

    Creates a function and gives it its URL at once. It serves nothing until its first deploy succeeds. Returns 201 with the function; there is no operation to follow.

    auth is key (the default: callers send one of the function's keys in the Authorization header) or public (anyone with the URL may call it).

    Idempotency: a retry with the same Idempotency-Key and body returns the function the first attempt created.

    POST/public/v1/functions
    Write keyNeeds Idempotency-KeyReturns201Created

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Body

    application/json
    • namestringrequired

      1 to 63 lowercase letters, digits and hyphens, starting with a letter; unique in its zone.

    • zone_idstringrequired

      The zone the function runs in, such as af-abj-2.

    • authstring

      key (the default) needs one of the function's keys; public lets anyone with the URL call it.

      One of key, public.

    • max_concurrencyinteger

      The most requests it serves at once. Left out, the organization's limit.

      At least 1.

    Response 201

    The function.
    • idstringrequired

      The function's id, starting fn_.

    • namestringrequired

      The function's name.

    • zone_idstringrequired

      The zone it runs in.

    • urlstringrequired

      Where it answers: https://<random>.fn.pantechdynamics.com.

    • authstringrequired

      key: callers send one of its keys. public: anyone with the URL.

      One of key, public.

    • max_concurrencyintegerrequired

      The most requests it serves at once.

    • latest_versionintegerrequired

      The newest version's number; 0 before the first deploy.

    • active_versionintegerrequired

      The version serving; 0 until a build first succeeds.

    • statestringrequired

      active, or deleted once deleted.

      One of active, deleted.

    • created_atstringrequired

      When it was created.

    • operation_idstringrequired

      The operation that created the function.

    Errors

    • 400IDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing. Send a new unique value, such as a UUID, with every write. INVALID_IDEMPOTENCY_KEY: the Idempotency-Key header is longer than 255 characters. Use a shorter value. INVALID_REQUEST_BODY: the body is not a single valid JSON object. Send one JSON object with the fields documented for this endpoint.
    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps. FUNCTIONS_UNAVAILABLE: functions are not available to this organization. FUNCTION_LIMIT_REACHED: the organization already has the most functions allowed. Delete one, or contact support to raise the limit.
    • 409FUNCTION_NAME_TAKEN: a function with that name already exists in this zone. Choose a different name. IDEMPOTENCY_CONFLICT: this Idempotency-Key was already used for a different request. Use a new key. ACCOUNT_SUSPENDED: the account has an overdue invoice. Pay it under Billing in the console, then try again. ACCOUNT_NOT_ACTIVE: billing setup is not finished. Finish it under Billing in the console, then try again.
    • 422VALIDATION_FAILED: a field is invalid. Each entry of errors names the field and its code: name REQUIRED or INVALID: use 1 to 63 lowercase letters, digits and hyphens, starting with a letter. zone_id REQUIRED: send a zone, such as af-abj-2. auth INVALID: use public or key. max_concurrency INVALID: use a number from 1 to the organization's limit. FUNCTION_ZONE_UNAVAILABLE: functions are not offered in this zone. Choose another zone.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    Body
    Idempotency
    curl -X POST "https://api.pantechdynamics.com/public/v1/functions" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "web-1",
        "zone_id": "af-abj-2"
      }'
    Response 201
    {
      "id": "id",
      "name": "web-1",
      "zone_id": "af-abj-2",
      "url": "https://x.serial-console.pantechdynamics.com/…",
      "auth": "key",
      "max_concurrency": 1,
      "latest_version": 1,
      "active_version": 1,
      "state": "active",
      "created_at": "2026-10-03T09:30:00Z",
      "operation_id": "op_06gk3x9tq7m2v8r4y1c5d0zp8w"
    }

    Get a function

    One function.

    GET/public/v1/functions/{function_id}
    Read keyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    Path parameters

    • function_idstringrequired

      The function's id.

    Response 200

    The function.
    • idstringrequired

      The function's id, starting fn_.

    • namestringrequired

      The function's name.

    • zone_idstringrequired

      The zone it runs in.

    • urlstringrequired

      Where it answers: https://<random>.fn.pantechdynamics.com.

    • authstringrequired

      key: callers send one of its keys. public: anyone with the URL.

      One of key, public.

    • max_concurrencyintegerrequired

      The most requests it serves at once.

    • latest_versionintegerrequired

      The newest version's number; 0 before the first deploy.

    • active_versionintegerrequired

      The version serving; 0 until a build first succeeds.

    • statestringrequired

      active, or deleted once deleted.

      One of active, deleted.

    • created_atstringrequired

      When it was created.

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    Path
    curl "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w" \
      -H "Authorization: Bearer $PANTECH_API_KEY"
    Response 200
    {
      "id": "id",
      "name": "web-1",
      "zone_id": "af-abj-2",
      "url": "https://x.serial-console.pantechdynamics.com/…",
      "auth": "key",
      "max_concurrency": 1,
      "latest_version": 1,
      "active_version": 1,
      "state": "active",
      "created_at": "2026-10-03T09:30:00Z"
    }

    Change a function

    Changes who may call the function (auth) and how many requests it serves at once (max_concurrency). Send either or both; the change applies to new requests within seconds.

    PATCH/public/v1/functions/{function_id}
    Write keyNeeds Idempotency-KeyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    Body

    application/json
    • authstring

      key or public.

      One of key, public.

    • max_concurrencyinteger

      The most requests it serves at once.

      At least 1.

    Response 200

    The function.
    • idstringrequired

      The function's id, starting fn_.

    • namestringrequired

      The function's name.

    • zone_idstringrequired

      The zone it runs in.

    • urlstringrequired

      Where it answers: https://<random>.fn.pantechdynamics.com.

    • authstringrequired

      key: callers send one of its keys. public: anyone with the URL.

      One of key, public.

    • max_concurrencyintegerrequired

      The most requests it serves at once.

    • latest_versionintegerrequired

      The newest version's number; 0 before the first deploy.

    • active_versionintegerrequired

      The version serving; 0 until a build first succeeds.

    • statestringrequired

      active, or deleted once deleted.

      One of active, deleted.

    • created_atstringrequired

      When it was created.

    Errors

    • 400IDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing. Send a new unique value, such as a UUID, with every write. INVALID_IDEMPOTENCY_KEY: the Idempotency-Key header is longer than 255 characters. Use a shorter value. INVALID_REQUEST_BODY: the body is not a single valid JSON object. Send one JSON object with the fields documented for this endpoint.
    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps. FUNCTIONS_UNAVAILABLE: functions are not available to this organization.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 409FUNCTION_DELETED: the function has been deleted.
    • 422VALIDATION_FAILED: auth must be public or key, and max_concurrency from 1 to the organization's limit; send at least one of them.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    Path
    Body
    Idempotency
    curl -X PATCH "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{}'
    Response 200
    {
      "id": "id",
      "name": "web-1",
      "zone_id": "af-abj-2",
      "url": "https://x.serial-console.pantechdynamics.com/…",
      "auth": "key",
      "max_concurrency": 1,
      "latest_version": 1,
      "active_version": 1,
      "state": "active",
      "created_at": "2026-10-03T09:30:00Z"
    }

    Delete a function

    Deletes the function: its URL stops answering at once and its keys stop working. Its versions and code are removed in the background. Works even when functions are switched off for your organization.

    Scope: write (an AI app's key also needs delete).

    DELETE/public/v1/functions/{function_id}
    Write keyNeeds Idempotency-KeyReturns202Accepted

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    Response 202

    The delete was accepted.
    • operation_idstringrequired

      The operation carrying out the change. Poll GET /public/v1/operations/{operation_id} (also the Location header) until status is succeeded or failed.

    • resource_idstringrequired

      The resource being created or changed, e.g. the new snapshot's id for a snapshot create.

    • statusstringrequired

      The operation's status when the request was accepted, usually submitting. Follow operation_id for the outcome.

    Errors

    • 400IDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing. Send a new unique value, such as a UUID, with every write. INVALID_IDEMPOTENCY_KEY: the Idempotency-Key header is longer than 255 characters. Use a shorter value. INVALID_REQUEST_BODY: the body is not a single valid JSON object. Send one JSON object with the fields documented for this endpoint.
    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    Path
    Idempotency
    curl -X DELETE "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)"
    Response 202
    {
      "operation_id": "op_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "resource_id": "id_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "status": "submitting"
    }

    Deploy a function

    Builds a new version from your code. The version is numbered, starts building, and serves once its build succeeds; follow operation_id until it finishes. The version that was serving keeps serving until then, and if the build fails.

    Send the code one of two ways:

    • One file: a JSON body with source.filename (such as index.mjs or main.py) and source.content, at most 256 KiB.
    • A zip: multipart/form-data with a spec part holding the same JSON without source, then a code part holding the zip, at most 25 MiB zipped and 250 MiB unpacked. Only files and folders; no links and no paths outside the zip.

    Environment variables marked secret are stored encrypted and never returned: reading a version shows their names only.

    Idempotency: a retry with the same Idempotency-Key returns the version the first attempt created.

    POST/public/v1/functions/{function_id}/deploy
    Write keyNeeds Idempotency-KeyReturns202Accepted

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    Body

    application/json
    • runtimestringrequired

      The language runtime and version. Node.js 22 and 24, Python 3.12 to 3.14, Bun 1.3 (JavaScript and TypeScript), Go 1.25, Ruby 3.3, PHP 8.4.

      One of nodejs22, nodejs24, python3.12, python3.13, python3.14, bun1.3, go1.25, ruby3.3, php8.4.

    • handlerstring

      What to call: file.export for Node.js, Bun, Ruby and PHP (default index.handler, Ruby handler.handler), module.function for Python (default main.handler), or main.Name for Go, an exported function of package main (default main.Handler).

    • memory_mibinteger

      Memory per instance, in MiB. Left out, 128.

      One of 128, 256, 512, 1024, 2048.

    • timeout_secondsinteger

      How long one request may run. Left out, 30.

      From 1 to 900.

    • environmentarray of FunctionEnvironmentVariable

      Environment variables, at most 4 KiB in all.

      Show 3 child fields
      • namestringrequired

        Letters, digits and underscores, not starting with a digit or PANTECH_.

      • valuestringrequired

        The value. Empty when reading a secret variable: secret values are never returned.

      • secretbooleanrequired

        Stored encrypted and never returned.

    • sourceobjectrequired

      The single source file.

      Show 2 child fields
      • filenamestringrequired

        The file's name, such as index.mjs or main.py, with no folders.

      • contentstringrequired

        The file's text, at most 256 KiB.

    Response 202

    The deploy was accepted.
    • operation_idstringrequired

      The build. Poll GET /public/v1/operations/{operation_id} (also the Location header) until it is succeeded or failed.

    • statusstringrequired

      The operation's status when accepted, usually submitting.

    • versionFunctionVersionrequired

      One deploy of a function's code and settings.

      Show 14 child fields
      • idstringrequired

        The version's id, starting fnv_.

      • function_idstringrequired

        The function.

      • numberintegerrequired

        1 for the first deploy, then 2, 3, …

      • runtimestringrequired

        The language runtime and version. Node.js 22 and 24, Python 3.12 to 3.14, Bun 1.3 (JavaScript and TypeScript), Go 1.25, Ruby 3.3, PHP 8.4.

        One of nodejs22, nodejs24, python3.12, python3.13, python3.14, bun1.3, go1.25, ruby3.3, php8.4.

      • handlerstringrequired

        What is called on each request.

      • memory_mibintegerrequired

        Memory per instance, in MiB.

      • timeout_secondsintegerrequired

        How long one request may run.

      • environmentarray of FunctionEnvironmentVariablerequired

        Its environment variables; secret ones without their values.

        Show 3 child fields
        • namestringrequired

          Letters, digits and underscores, not starting with a digit or PANTECH_.

        • valuestringrequired

          The value. Empty when reading a secret variable: secret values are never returned.

        • secretbooleanrequired

          Stored encrypted and never returned.

      • code_sha256stringrequired

        The SHA-256 of the zip that was deployed, in hex.

      • statestringrequired

        building, then ready (it can serve) or failed.

        One of building, ready, failed.

      • failure_reasonstring or nullrequired

        Why the build failed; null otherwise.

      • activebooleanrequired

        It is the version serving.

      • created_atstringrequired

        When it was deployed.

      • finished_atstring or nullrequired

        When its build finished; null while building.

    Errors

    • 400IDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing. Send a new unique value, such as a UUID, with every write. INVALID_IDEMPOTENCY_KEY: the Idempotency-Key header is longer than 255 characters. Use a shorter value. INVALID_REQUEST_BODY: the body is not a single valid JSON object. Send one JSON object with the fields documented for this endpoint.
    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps. FUNCTIONS_UNAVAILABLE: functions are not available to this organization.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 409FUNCTION_DELETED: the function has been deleted. IDEMPOTENCY_CONFLICT: this Idempotency-Key was already used for a different request. Use a new key. ACCOUNT_SUSPENDED: the account has an overdue invoice. Pay it under Billing in the console, then try again. ACCOUNT_NOT_ACTIVE: billing setup is not finished. Finish it under Billing in the console, then try again.
    • 413FUNCTION_CODE_TOO_LARGE: the code is over 25 MiB zipped or 250 MiB unpacked. Remove what the function does not need, such as tests and build tools.
    • 422VALIDATION_FAILED: a field is invalid. Each entry of errors names the field and its code: runtime REQUIRED or INVALID: use nodejs22, nodejs24, python3.12, python3.13, python3.14, bun1.3, go1.25, ruby3.3 or php8.4. handler INVALID: use file.export for Node.js, Bun, Ruby and PHP, module.function for Python, or main.Name for Go. memory_mib INVALID: use 128, 256, 512, 1024 or 2048. timeout_seconds INVALID: use 1 to 900. environment INVALID: names are letters, digits and underscores, not starting PANTECH_, with at most 4 KiB in all. source INVALID_FUNCTION_SOURCE: a file name with no folders, and content of at most 256 KiB. code FUNCTION_CODE_REQUIRED: send a zip as the code part, or a single file as source. FUNCTION_CODE_INVALID: the zip is not a zip of plain files and folders.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    Path
    Body
    Idempotency
    curl -X POST "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/deploy" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
        "runtime": "nodejs22",
        "source": {
          "filename": "filename",
          "content": "content"
        }
      }'
    Response 202
    {
      "operation_id": "op_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "status": "active",
      "version": {
        "id": "id",
        "function_id": "function-id",
        "number": 100,
        "runtime": "nodejs22",
        "handler": "handler",
        "memory_mib": 1,
        "timeout_seconds": 1,
        "environment": [
          {
            "name": "web-1",
            "value": "value",
            "secret": true
          }
        ],
        "code_sha256": "code-sha256",
        "state": "building",
        "failure_reason": null,
        "active": true,
        "created_at": "2026-10-03T09:30:00Z",
        "finished_at": "2026-10-03T09:30:00Z"
      }
    }

    List a function's keys

    The keys a key function is called with. A key itself is shown only when it is created; this list shows its last four characters as hint.

    GET/public/v1/functions/{function_id}/keys
    Read keyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    Path parameters

    • function_idstringrequired

      The function's id.

    Response 200

    Keys.
    • dataarray of FunctionKeyrequired
      Show 6 child fields
      • idstringrequired

        The key's id, starting fnk_.

      • function_idstringrequired

        The function it opens.

      • namestringrequired

        The key's name.

      • hintstringrequired

        The key's last four characters, to tell keys apart.

      • created_atstringrequired

        When it was created.

      • revoked_atstring or nullrequired

        When it was revoked; null while it works.

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    Path
    curl "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/keys" \
      -H "Authorization: Bearer $PANTECH_API_KEY"
    Response 200
    {
      "data": [
        {
          "id": "id",
          "function_id": "function-id",
          "name": "web-1",
          "hint": "hint",
          "created_at": "2026-10-03T09:30:00Z",
          "revoked_at": "2026-10-03T09:30:00Z"
        }
      ]
    }

    Create a function key

    Creates a key callers send as Authorization: Bearer <key>. The key is in this response only and is never shown again; store it now. A function has at most 10 keys that are not revoked.

    Idempotency: a retry with the same Idempotency-Key is not replayed: it creates another key. If a request may have gone through, list the keys and revoke one you did not receive.

    POST/public/v1/functions/{function_id}/keys
    Write keyNeeds Idempotency-KeyReturns201Created

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    Body

    application/json
    • namestringrequired

      A name for the key, such as billing-service: 1 to 63 lowercase letters, digits and hyphens.

    Response 201

    The key, with the key itself.
    • idstringrequired

      The key's id, starting fnk_.

    • function_idstringrequired

      The function it opens.

    • namestringrequired

      The key's name.

    • hintstringrequired

      The key's last four characters, to tell keys apart.

    • created_atstringrequired

      When it was created.

    • revoked_atstring or nullrequired

      When it was revoked; null while it works.

    • keystringrequired

      The key itself, starting pfk_. Callers send it as Authorization: Bearer <key>. Store it now: it is never shown again.

    Errors

    • 400IDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing. Send a new unique value, such as a UUID, with every write. INVALID_IDEMPOTENCY_KEY: the Idempotency-Key header is longer than 255 characters. Use a shorter value. INVALID_REQUEST_BODY: the body is not a single valid JSON object. Send one JSON object with the fields documented for this endpoint.
    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps. FUNCTIONS_UNAVAILABLE: functions are not available to this organization. FUNCTION_KEY_LIMIT_REACHED: the function already has 10 keys. Revoke one first.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 422VALIDATION_FAILED: name must be 1 to 63 lowercase letters, digits and hyphens, starting with a letter.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    Path
    Body
    Idempotency
    curl -X POST "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/keys" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "web-1"
      }'
    Response 201
    {
      "id": "id",
      "function_id": "function-id",
      "name": "web-1",
      "hint": "hint",
      "created_at": "2026-10-03T09:30:00Z",
      "revoked_at": "2026-10-03T09:30:00Z",
      "key": "key"
    }

    Revoke a function key

    The key stops working within seconds. Revoked keys stay listed with revoked_at. Works even when functions are switched off for your organization.

    Scope: write (an AI app's key also needs delete).

    DELETE/public/v1/functions/{function_id}/keys/{key_id}
    Write keyNeeds Idempotency-KeyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    • key_idstringrequired

      The key's id.

    Response 200

    The revoked key.
    • idstringrequired

      The key's id, starting fnk_.

    • function_idstringrequired

      The function it opens.

    • namestringrequired

      The key's name.

    • hintstringrequired

      The key's last four characters, to tell keys apart.

    • created_atstringrequired

      When it was created.

    • revoked_atstring or nullrequired

      When it was revoked; null while it works.

    Errors

    • 400IDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing. Send a new unique value, such as a UUID, with every write. INVALID_IDEMPOTENCY_KEY: the Idempotency-Key header is longer than 255 characters. Use a shorter value. INVALID_REQUEST_BODY: the body is not a single valid JSON object. Send one JSON object with the fields documented for this endpoint.
    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it. FUNCTION_KEY_NOT_FOUND: the function has no key with this id.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    Path
    Idempotency
    curl -X DELETE "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/keys/id_06gk3x9tq7m2v8r4y1c5d0zp8w" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)"
    Response 200
    {
      "id": "id",
      "function_id": "function-id",
      "name": "web-1",
      "hint": "hint",
      "created_at": "2026-10-03T09:30:00Z",
      "revoked_at": "2026-10-03T09:30:00Z"
    }

    List a function's versions

    Every version deployed, newest first, with its build state. active marks the one serving.

    GET/public/v1/functions/{function_id}/versions
    Read keyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    Path parameters

    • function_idstringrequired

      The function's id.

    Response 200

    Versions.
    • dataarray of FunctionVersionrequired
      Show 14 child fields
      • idstringrequired

        The version's id, starting fnv_.

      • function_idstringrequired

        The function.

      • numberintegerrequired

        1 for the first deploy, then 2, 3, …

      • runtimestringrequired

        The language runtime and version. Node.js 22 and 24, Python 3.12 to 3.14, Bun 1.3 (JavaScript and TypeScript), Go 1.25, Ruby 3.3, PHP 8.4.

        One of nodejs22, nodejs24, python3.12, python3.13, python3.14, bun1.3, go1.25, ruby3.3, php8.4.

      • handlerstringrequired

        What is called on each request.

      • memory_mibintegerrequired

        Memory per instance, in MiB.

      • timeout_secondsintegerrequired

        How long one request may run.

      • environmentarray of FunctionEnvironmentVariablerequired

        Its environment variables; secret ones without their values.

        Show 3 child fields
        • namestringrequired

          Letters, digits and underscores, not starting with a digit or PANTECH_.

        • valuestringrequired

          The value. Empty when reading a secret variable: secret values are never returned.

        • secretbooleanrequired

          Stored encrypted and never returned.

      • code_sha256stringrequired

        The SHA-256 of the zip that was deployed, in hex.

      • statestringrequired

        building, then ready (it can serve) or failed.

        One of building, ready, failed.

      • failure_reasonstring or nullrequired

        Why the build failed; null otherwise.

      • activebooleanrequired

        It is the version serving.

      • created_atstringrequired

        When it was deployed.

      • finished_atstring or nullrequired

        When its build finished; null while building.

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    Path
    curl "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/versions" \
      -H "Authorization: Bearer $PANTECH_API_KEY"
    Response 200
    {
      "data": [
        {
          "id": "id",
          "function_id": "function-id",
          "number": 100,
          "runtime": "nodejs22",
          "handler": "handler",
          "memory_mib": 1,
          "timeout_seconds": 1,
          "environment": [
            {
              "name": "web-1",
              "value": "value",
              "secret": true
            }
          ],
          "code_sha256": "code-sha256",
          "state": "building",
          "failure_reason": null,
          "active": true,
          "created_at": "2026-10-03T09:30:00Z",
          "finished_at": "2026-10-03T09:30:00Z"
        }
      ]
    }

    Serve a version

    Makes this version the one that serves: a rollback to an earlier version, or forward again. Only a version whose build succeeded can serve. New requests reach it within seconds.

    POST/public/v1/functions/{function_id}/versions/{number}/activate
    Write keyNeeds Idempotency-KeyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    • numberintegerrequired

      The version number: 1 for the first deploy, then 2, 3, …

      At least 1.

    Response 200

    The function.
    • idstringrequired

      The function's id, starting fn_.

    • namestringrequired

      The function's name.

    • zone_idstringrequired

      The zone it runs in.

    • urlstringrequired

      Where it answers: https://<random>.fn.pantechdynamics.com.

    • authstringrequired

      key: callers send one of its keys. public: anyone with the URL.

      One of key, public.

    • max_concurrencyintegerrequired

      The most requests it serves at once.

    • latest_versionintegerrequired

      The newest version's number; 0 before the first deploy.

    • active_versionintegerrequired

      The version serving; 0 until a build first succeeds.

    • statestringrequired

      active, or deleted once deleted.

      One of active, deleted.

    • created_atstringrequired

      When it was created.

    Errors

    • 400IDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing. Send a new unique value, such as a UUID, with every write. INVALID_IDEMPOTENCY_KEY: the Idempotency-Key header is longer than 255 characters. Use a shorter value. INVALID_REQUEST_BODY: the body is not a single valid JSON object. Send one JSON object with the fields documented for this endpoint.
    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps. FUNCTIONS_UNAVAILABLE: functions are not available to this organization.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it. FUNCTION_VERSION_NOT_FOUND: the function has no version with this number.
    • 409FUNCTION_VERSION_NOT_READY: only a version whose build succeeded can serve. FUNCTION_DELETED: the function has been deleted.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503SERVICE_UNAVAILABLE: request quota storage is unavailable. Wait a few seconds, then retry.

    Every code is explained in Errors.

    Authorization
    Path
    Idempotency
    curl -X POST "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/versions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/activate" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)"
    Response 200
    {
      "id": "id",
      "name": "web-1",
      "zone_id": "af-abj-2",
      "url": "https://x.serial-console.pantechdynamics.com/…",
      "auth": "key",
      "max_concurrency": 1,
      "latest_version": 1,
      "active_version": 1,
      "state": "active",
      "created_at": "2026-10-03T09:30:00Z"
    }

    List a function's invocations

    Every call of the function in the last 7 days, newest first, with its outcome, status and duration, and how many lines its code printed to stdout and stderr. Get one invocation to read its lines. A call appears within a few seconds of finishing.

    Scope: write, because logs hold whatever the code printed.

    GET/public/v1/functions/{function_id}/invocations
    Write keyNeeds Idempotency-KeyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    Query parameters

    • limitinteger

      Items per page, 1 to 100. Defaults to 50.

      From 1 to 100. Defaults to 50.

    • cursorstring

      The previous page's next_cursor, to get the next page. Leave out for the first page; keep the other parameters the same.

    • outcomestring

      Only these outcomes, comma-separated: ok, error (the handler threw or returned an error), timeout, crashed.

    • qstring

      Only invocations with a line containing this text (case-sensitive), at most 200 characters on one line.

      At most 200 characters.

    • request_idstring

      Only the invocation with this request id, from the response's X-Request-Id header.

    • sincestring

      Only invocations that started at or after this time (RFC 3339).

    • untilstring

      Only invocations that started before this time (RFC 3339).

    Response 200

    Invocations, without their lines.
    • dataarray of FunctionInvocationSummaryrequired
      Show 8 child fields
      • request_idstringrequired

        The call's request id, as its response's X-Request-Id header gave it.

      • versionintegerrequired

        The version that served it.

      • started_atstringrequired

        When the call started.

      • duration_msnumberrequired

        How long it ran, in milliseconds.

      • outcomestringrequired

        ok it returned; error it threw or returned an error; timeout it ran past its timeout; crashed its process exited.

        One of ok, error, timeout, crashed.

      • statusintegerrequired

        The HTTP status the caller received.

      • line_countintegerrequired

        How many lines it printed.

      • dropped_bytesintegerrequired

        Bytes of output left out because the call printed more than 256 KiB; 0 when nothing was.

    • next_cursorstring or nullrequired

      Pass as cursor for older invocations; null on the last page.

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. Reading logs needs the functions:ReadLogs permission, which owners, admins and developers have. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 422VALIDATION_FAILED: a filter is not valid: limit 1 to 100, cursor from a previous page, outcome from the list above, q at most 200 characters on one line, since and until RFC 3339 times with since before until.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503FUNCTION_LOGS_UNAVAILABLE: logs cannot be read right now. Retry shortly. QUOTA_UNAVAILABLE: the request quota could not be checked. Retry shortly.

    Every code is explained in Errors.

    Authorization
    Path
    Query
    Idempotency
    curl "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/invocations" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)"
    Response 200
    {
      "data": [
        {
          "request_id": "request-id",
          "version": 1,
          "started_at": "2026-10-03T09:30:00Z",
          "duration_ms": 1,
          "outcome": "ok",
          "status": 1,
          "line_count": 1,
          "dropped_bytes": 1
        }
      ],
      "next_cursor": "eyJhdCI6IjIwMjYtMTAtMDNUMDk6MzA6MDBaIiwiaWQiOiJ2bV8wNmdrIn0"
    }

    Get an invocation's logs

    One call of the function with every line its code printed, in order, each with its time and stream. A call keeps up to 256 KiB of output; beyond that the middle is left out and dropped_bytes says how much.

    Scope: write, because logs hold whatever the code printed.

    GET/public/v1/functions/{function_id}/invocations/{request_id}
    Write keyNeeds Idempotency-KeyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    • request_idstringrequired

      The invocation's request id, from the response's X-Request-Id header.

    Response 200

    The invocation with its lines.
    • request_idstringrequired

      The call's request id, as its response's X-Request-Id header gave it.

    • versionintegerrequired

      The version that served it.

    • started_atstringrequired

      When the call started.

    • duration_msnumberrequired

      How long it ran, in milliseconds.

    • outcomestringrequired

      ok it returned; error it threw or returned an error; timeout it ran past its timeout; crashed its process exited.

      One of ok, error, timeout, crashed.

    • statusintegerrequired

      The HTTP status the caller received.

    • line_countintegerrequired

      How many lines it printed.

    • dropped_bytesintegerrequired

      Bytes of output left out because the call printed more than 256 KiB; 0 when nothing was.

    • linesarray of FunctionLogLinerequired

      Every line it printed, in order.

      Show 3 child fields
      • atstringrequired

        When the line was printed.

      • streamstringrequired

        Where it was printed.

        One of stdout, stderr.

      • textstringrequired

        The line, without its newline. Control characters and terminal colour codes are removed.

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. Reading logs needs the functions:ReadLogs permission, which owners, admins and developers have. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it. FUNCTION_INVOCATION_NOT_FOUND: no invocation with this request id in the last 7 days.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503FUNCTION_LOGS_UNAVAILABLE: logs cannot be read right now. Retry shortly. QUOTA_UNAVAILABLE: the request quota could not be checked. Retry shortly.

    Every code is explained in Errors.

    Authorization
    Path
    Idempotency
    curl "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/invocations/id_06gk3x9tq7m2v8r4y1c5d0zp8w" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)"
    Response 200
    {
      "request_id": "request-id",
      "version": 1,
      "started_at": "2026-10-03T09:30:00Z",
      "duration_ms": 1,
      "outcome": "ok",
      "status": 1,
      "line_count": 1,
      "dropped_bytes": 1,
      "lines": [
        {
          "at": "2026-10-03T09:30:00Z",
          "stream": "stdout",
          "text": "text"
        }
      ]
    }

    Invoke a function

    Calls the function's active version with the request body as its event and waits up to 60 seconds (or the function's own timeout, if shorter) for what its handler returns. The call skips the function's own authentication, so it works whether the function is public or needs a key, and it is billed like any other call.

    The body is any JSON value up to 6 MiB; an empty body is the event {}. The answer is 200 whenever the handler ran, even if it threw or timed out: read outcome. This call takes no Idempotency-Key: each request runs the function once, and a retry runs it again, as a retried call to its URL would. The call's printed lines are at GET /public/v1/functions/{function_id}/invocations/{request_id} a few seconds later.

    POST/public/v1/functions/{function_id}/invocations
    Write keyNeeds Idempotency-KeyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    Body

    application/json

    No fields.

    Response 200

    The handler ran; outcome says how it ended.
    • request_idstringrequired

      The call's request id; its logs are under this id.

    • versionintegerrequired

      The version that ran.

    • outcomestringrequired

      ok the handler returned; error it threw or returned an error; timeout it ran past its timeout; crashed its runtime stopped.

      One of ok, error, timeout, crashed.

    • duration_msnumberrequired

      How long the handler ran, in milliseconds.

    • responseobjectrequired

      What the handler returned, as JSON, when outcome is ok; otherwise null.

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. Invoking needs the functions:Invoke permission, which owners, admins and developers have. FUNCTION_SUSPENDED: the function's organization is suspended, so it does not run. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 409FUNCTION_NOT_SERVING: the function has no version serving yet, or was deleted. Deploy a version and wait for it to be ready.
    • 413FUNCTION_EVENT_TOO_LARGE: the event is over 6 MiB.
    • 422VALIDATION_FAILED: the body is not a JSON value (event).
    • 429FUNCTION_CONCURRENCY_LIMIT: the function is running as many calls as its concurrency limit allows. Retry after Retry-After. RATE_LIMITED: too many requests for this key. Retry after Retry-After.
    • 503FUNCTION_BUSY: no capacity is free to run the function right now. Retry shortly. FUNCTION_INVOKE_UNAVAILABLE: functions cannot be invoked right now. Retry shortly. QUOTA_UNAVAILABLE: the request quota could not be checked. Retry shortly.

    Every code is explained in Errors.

    Authorization
    Path
    Body
    Idempotency
    curl -X POST "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/invocations" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "Ada"
      }'
    Response 200
    {
      "request_id": "request-id",
      "version": 1,
      "outcome": "ok",
      "duration_ms": 1,
      "response": null
    }

    Invoke a function asynchronously

    Accepts the request body as an event and answers 202 at once; the function runs it shortly after. If the handler fails (it throws, crashes or times out), it is tried again after one minute, then after two (max_retries, default 2). A call that cannot reach the handler (the function is at its concurrency limit, busy, or not serving yet) waits 30 seconds and tries again without using a retry. An invocation not finished within max_event_age_seconds (default 6 hours) expires.

    When an invocation fails on every attempt, or expires, the organization's webhooks subscribed to function.async_invocation_failed receive an event naming it, so your own endpoint can act on it. Read an invocation's status at GET /public/v1/functions/{function_id}/async-invocations/{invocation_id}; each attempt is also an invocation in the function's logs, under the attempt's last_request_id.

    The body is any JSON value up to 256 KiB; an empty body is the event {}. Each attempt is billed like any call. Send an Idempotency-Key: a retried request with the same key returns the same invocation instead of queuing it again. A function holds at most 10,000 invocations waiting.

    POST/public/v1/functions/{function_id}/async-invocations
    Write keyNeeds Idempotency-KeyReturns202Accepted

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    Query parameters

    • max_retriesinteger

      How often a failed handler is tried again, 0 to 2. Default 2.

      From 0 to 2.

    • max_event_age_secondsinteger

      How long the invocation may wait for a successful run, 60 to 21600 seconds. Default 21600 (6 hours).

      From 60 to 21600.

    Body

    application/json

    No fields.

    Response 202

    Accepted; the function runs it shortly.
    • idstringrequired

      The invocation's id (fna_…).

    • function_idstringrequired
    • statusstringrequired

      queued until it succeeds, fails on every attempt it was allowed, or reaches its maximum age.

      One of queued, succeeded, failed, expired.

    • attemptsintegerrequired

      How many attempts reached the handler.

    • max_retriesintegerrequired
    • max_event_age_secondsintegerrequired
    • last_outcomestring or nullrequired

      The last attempt's outcome: the handler's (ok, error, timeout, crashed), or why the call did not reach it.

      One of ok, error, timeout, crashed, not_serving, suspended, throttled, busy, failed, function_deleted, null.

    • last_request_idstring or nullrequired

      The last attempt's request id, as in the function's logs.

    • created_atstringrequired
    • next_attempt_atstring or nullrequired

      When it is tried next; null once finished.

    • finished_atstring or nullrequired

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Invoking needs the functions:Invoke permission, which owners, admins and developers have. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 409FUNCTION_DELETED: the function has been deleted.
    • 413FUNCTION_ASYNC_EVENT_TOO_LARGE: the event is over 256 KiB. Send a larger payload by direct invoke, or store it and send its address.
    • 422VALIDATION_FAILED: a field is invalid. Each entry of errors names the field and its code: event INVALID: send a JSON value as the body. max_retries OUT_OF_RANGE: use 0, 1 or 2. max_event_age_seconds OUT_OF_RANGE: use 60 to 21600.
    • 429FUNCTION_ASYNC_BACKLOG_FULL: the function already has 10,000 invocations waiting. Retry once some have run. RATE_LIMITED: too many requests. Wait for Retry-After and retry.
    • 503FUNCTION_ASYNC_UNAVAILABLE: async invoke is not available right now. Retry shortly.

    Every code is explained in Errors.

    Authorization
    Path
    Query
    Body
    Idempotency
    curl -X POST "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/async-invocations" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{}'
    Response 202
    {
      "id": "id",
      "function_id": "function-id",
      "status": "queued",
      "attempts": 1,
      "max_retries": 1,
      "max_event_age_seconds": 1,
      "last_outcome": "ok",
      "last_request_id": "last-request-id",
      "created_at": "2026-10-03T09:30:00Z",
      "next_attempt_at": "2026-10-03T09:30:00Z",
      "finished_at": "2026-10-03T09:30:00Z"
    }

    Get a function's metrics

    How the function's calls went over a period, in equal steps: how many reached the handler and how they ended, how many were refused at the concurrency limit or for want of capacity, cold starts, and durations (average and percentiles). It also gives the function's metered usage since the start of this month (UTC). A step appears about a minute after it ends; metrics are kept 14 days.

    Durations are estimated from a histogram, so a percentile is accurate to its bucket. They are null in a step where no call reached the handler.

    GET/public/v1/functions/{function_id}/metrics
    Read keyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    Path parameters

    • function_idstringrequired

      The function's id.

    Query parameters

    • periodstring

      How far back: 1h in 1-minute steps, 6h in 5-minute steps, 24h (the default) in 15-minute steps, 7d in hourly steps, 14d in 3-hour steps.

      One of 1h, 6h, 24h, 7d, 14d. Defaults to 24h.

    Response 200

    The function's metrics.
    • periodstringrequired

      One of 1h, 6h, 24h, 7d, 14d.

    • sincestringrequired

      Start of the first step.

    • untilstringrequired

      End of the last step, which is still in progress.

    • step_secondsintegerrequired

      Length of each step.

    • pointsarray of FunctionMetricsPointrequired

      One per step, oldest first, empty steps included.

      Show 13 child fields
      • startstringrequired

        When the step starts.

      • requestsintegerrequired

        Calls that reached the handler.

      • errorsintegerrequired

        Of those, calls whose handler threw or returned an error.

      • timeoutsintegerrequired

        Of those, calls that ran past the function's timeout.

      • crashesintegerrequired

        Of those, calls whose runtime stopped.

      • throttledintegerrequired

        Calls refused with 429 because the function was running as many requests as its concurrency limit allows.

      • busyintegerrequired

        Calls refused with 503 for want of free capacity.

      • cold_startsintegerrequired

        Calls that had to start a new instance first.

      • avg_duration_msnumber or nullrequired

        Average time the handler ran, in milliseconds.

      • p50_msnumber or nullrequired

        Median duration, in milliseconds.

      • p95_msnumber or nullrequired

        95th-percentile duration, in milliseconds.

      • p99_msnumber or nullrequired

        99th-percentile duration, in milliseconds.

      • avg_startup_msnumber or nullrequired

        Average time a cold start took before the handler ran, in milliseconds; null with no cold starts.

    • totalFunctionMetricsCountsrequired
      Show 12 child fields
      • requestsintegerrequired

        Calls that reached the handler.

      • errorsintegerrequired

        Of those, calls whose handler threw or returned an error.

      • timeoutsintegerrequired

        Of those, calls that ran past the function's timeout.

      • crashesintegerrequired

        Of those, calls whose runtime stopped.

      • throttledintegerrequired

        Calls refused with 429 because the function was running as many requests as its concurrency limit allows.

      • busyintegerrequired

        Calls refused with 503 for want of free capacity.

      • cold_startsintegerrequired

        Calls that had to start a new instance first.

      • avg_duration_msnumber or nullrequired

        Average time the handler ran, in milliseconds.

      • p50_msnumber or nullrequired

        Median duration, in milliseconds.

      • p95_msnumber or nullrequired

        95th-percentile duration, in milliseconds.

      • p99_msnumber or nullrequired

        99th-percentile duration, in milliseconds.

      • avg_startup_msnumber or nullrequired

        Average time a cold start took before the handler ran, in milliseconds; null with no cold starts.

    • monthobjectrequired

      Metered usage since the start of this month (UTC), in whole hours; the current hour is added once it ends.

      Show 2 child fields
      • requestsintegerrequired

        Billable calls.

      • gib_secondsnumberrequired

        Memory multiplied by duration, in GiB-seconds.

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404FUNCTION_NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 422VALIDATION_FAILED: period is not one of 1h, 6h, 24h, 7d or 14d.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503FUNCTION_METRICS_UNAVAILABLE: metrics cannot be read right now. Retry shortly. QUOTA_UNAVAILABLE: the request quota could not be checked. Retry shortly.

    Every code is explained in Errors.

    Authorization
    Path
    Query
    curl "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/metrics" \
      -H "Authorization: Bearer $PANTECH_API_KEY"
    Response 200
    {
      "period": "1h",
      "since": "2026-10-03T09:30:00Z",
      "until": "2026-10-03T09:30:00Z",
      "step_seconds": 1,
      "points": [
        {
          "start": "2026-10-03T09:30:00Z",
          "requests": 1,
          "errors": 1,
          "timeouts": 1,
          "crashes": 1,
          "throttled": 1,
          "busy": 1,
          "cold_starts": 1,
          "avg_duration_ms": 1,
          "p50_ms": 1,
          "p95_ms": 1,
          "p99_ms": 1,
          "avg_startup_ms": 1
        }
      ],
      "total": {
        "requests": 1,
        "errors": 1,
        "timeouts": 1,
        "crashes": 1,
        "throttled": 1,
        "busy": 1,
        "cold_starts": 1,
        "avg_duration_ms": 1,
        "p50_ms": 1,
        "p95_ms": 1,
        "p99_ms": 1,
        "avg_startup_ms": 1
      },
      "month": {
        "requests": 1,
        "gib_seconds": 1
      }
    }

    List a function's async invocations

    The function's async invocations, newest first: those waiting, and those finished in the last 7 days. Filter by status.

    GET/public/v1/functions/{function_id}/async-invocations
    Read keyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    Path parameters

    • function_idstringrequired

      The function's id.

    Query parameters

    • statusstring

      Only invocations in this status.

      One of queued, succeeded, failed, expired.

    • limitinteger

      At most this many, 1 to 100. Default 50.

      From 1 to 100.

    • cursorstring

      The previous page's next_cursor, to get the next page. Leave out for the first page; keep the other parameters the same.

    Response 200

    One page of async invocations.
    • dataarray of FunctionAsyncInvocationrequired
      Show 11 child fields
      • idstringrequired

        The invocation's id (fna_…).

      • function_idstringrequired
      • statusstringrequired

        queued until it succeeds, fails on every attempt it was allowed, or reaches its maximum age.

        One of queued, succeeded, failed, expired.

      • attemptsintegerrequired

        How many attempts reached the handler.

      • max_retriesintegerrequired
      • max_event_age_secondsintegerrequired
      • last_outcomestring or nullrequired

        The last attempt's outcome: the handler's (ok, error, timeout, crashed), or why the call did not reach it.

        One of ok, error, timeout, crashed, not_serving, suspended, throttled, busy, failed, function_deleted, null.

      • last_request_idstring or nullrequired

        The last attempt's request id, as in the function's logs.

      • created_atstringrequired
      • next_attempt_atstring or nullrequired

        When it is tried next; null once finished.

      • finished_atstring or nullrequired
    • next_cursorstring or nullrequired

      Pass as cursor for the next page; null on the last.

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Reading needs the functions:Read permission. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 422VALIDATION_FAILED: a field is invalid. Each entry of errors names the field and its code: status INVALID: use queued, succeeded, failed or expired. limit OUT_OF_RANGE: use 1 to 100.

    Every code is explained in Errors.

    Authorization
    Path
    Query
    curl "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/async-invocations" \
      -H "Authorization: Bearer $PANTECH_API_KEY"
    Response 200
    {
      "data": [
        {
          "id": "id",
          "function_id": "function-id",
          "status": "queued",
          "attempts": 1,
          "max_retries": 1,
          "max_event_age_seconds": 1,
          "last_outcome": "ok",
          "last_request_id": "last-request-id",
          "created_at": "2026-10-03T09:30:00Z",
          "next_attempt_at": "2026-10-03T09:30:00Z",
          "finished_at": "2026-10-03T09:30:00Z"
        }
      ],
      "next_cursor": "eyJhdCI6IjIwMjYtMTAtMDNUMDk6MzA6MDBaIiwiaWQiOiJ2bV8wNmdrIn0"
    }

    List a function's schedules

    The schedules that call the function on a timetable, oldest first, each with its next run and how its last run ended.

    GET/public/v1/functions/{function_id}/schedules
    Read keyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    Path parameters

    • function_idstringrequired

      The function's id.

    Response 200

    The function's schedules.
    • dataarray of FunctionSchedulerequired
      Show 12 child fields
      • idstringrequired

        The schedule's id, starting fns_.

      • function_idstringrequired

        The function it calls.

      • expressionstringrequired

        Five cron fields, a shortcut such as @daily, or rate(N minutes|hours|days).

      • time_zonestringrequired

        The IANA time zone cron is read in.

      • descriptionstringrequired

        A note for people; empty when none.

      • inputobject | array | string | number | boolean or nullrequired

        JSON passed to every run as the event's input; null when none.

      • statestringrequired

        active runs on the timetable; paused does not.

        One of active, paused.

      • next_run_atstring or nullrequired

        When it runs next; null while paused.

      • last_run_atstring or nullrequired

        When the last run was due; null before the first.

      • last_outcomestring or nullrequired

        How the last run ended: ok, error, timeout or crashed as for any call; not_serving (no version was serving), suspended, throttled (at the concurrency limit), busy (no capacity), or failed (it could not be called). Null before the first run.

        One of ok, error, timeout, crashed, not_serving, suspended, throttled, busy, failed, null.

      • last_request_idstring or nullrequired

        The last run's request id, to find its logs; null when it did not reach the code.

      • created_atstringrequired

        When it was added.

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404FUNCTION_NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503FUNCTION_SCHEDULES_UNAVAILABLE: schedules cannot be read or changed right now. Retry shortly. QUOTA_UNAVAILABLE: the request quota could not be checked. Retry shortly.

    Every code is explained in Errors.

    Authorization
    Path
    curl "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/schedules" \
      -H "Authorization: Bearer $PANTECH_API_KEY"
    Response 200
    {
      "data": [
        {
          "id": "fns_06gk3x9tq7m2v8r4y1c5d0zp8w",
          "function_id": "function-id",
          "expression": "expression",
          "time_zone": "time-zone",
          "description": "description",
          "input": {},
          "state": "active",
          "next_run_at": "2026-10-03T09:30:00Z",
          "last_run_at": "2026-10-03T09:30:00Z",
          "last_outcome": "ok",
          "last_request_id": "last-request-id",
          "created_at": "2026-10-03T09:30:00Z"
        }
      ]
    }

    Get an async invocation

    One async invocation: its status, how many attempts reached the handler, the last attempt's outcome and request id (whose printed lines are in the function's logs), and when it runs next or finished. Finished invocations are kept for 7 days.

    GET/public/v1/functions/{function_id}/async-invocations/{invocation_id}
    Read keyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    Path parameters

    • function_idstringrequired

      The function's id.

    • invocation_idstringrequired

      The invocation's id (fna_…).

    Response 200

    The invocation.
    • idstringrequired

      The invocation's id (fna_…).

    • function_idstringrequired
    • statusstringrequired

      queued until it succeeds, fails on every attempt it was allowed, or reaches its maximum age.

      One of queued, succeeded, failed, expired.

    • attemptsintegerrequired

      How many attempts reached the handler.

    • max_retriesintegerrequired
    • max_event_age_secondsintegerrequired
    • last_outcomestring or nullrequired

      The last attempt's outcome: the handler's (ok, error, timeout, crashed), or why the call did not reach it.

      One of ok, error, timeout, crashed, not_serving, suspended, throttled, busy, failed, function_deleted, null.

    • last_request_idstring or nullrequired

      The last attempt's request id, as in the function's logs.

    • created_atstringrequired
    • next_attempt_atstring or nullrequired

      When it is tried next; null once finished.

    • finished_atstring or nullrequired

    Errors

    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Reading needs the functions:Read permission. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404NOT_FOUND: no function with this id exists in your organization. FUNCTION_ASYNC_INVOCATION_NOT_FOUND: no async invocation with this id is kept for the function. Finished ones are kept for 7 days.

    Every code is explained in Errors.

    Authorization
    Path
    curl "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/async-invocations/id_06gk3x9tq7m2v8r4y1c5d0zp8w" \
      -H "Authorization: Bearer $PANTECH_API_KEY"
    Response 200
    {
      "id": "id",
      "function_id": "function-id",
      "status": "queued",
      "attempts": 1,
      "max_retries": 1,
      "max_event_age_seconds": 1,
      "last_outcome": "ok",
      "last_request_id": "last-request-id",
      "created_at": "2026-10-03T09:30:00Z",
      "next_attempt_at": "2026-10-03T09:30:00Z",
      "finished_at": "2026-10-03T09:30:00Z"
    }

    Add a schedule to a function

    Calls the function on a timetable, starting at the next time the expression matches. Each run calls the version serving at that moment with this event:

    {"trigger": "schedule", "schedule_id": "fns_...", "event_id": "...", "scheduled_at": "...", "input": ...}

    A run is delivered at least once: in rare cases (a restart mid-run) it can be called twice with the same event_id, so a handler that must not repeat its work should remember the ids it has seen. Runs that were missed while the platform could not call the function are not caught up one by one; the schedule runs once and moves on. Each run is billed as a call.

    expression is five cron fields (minute hour day-of-month month day-of-week, with lists, ranges, steps and names such as MON-FRI), a shortcut (@hourly, @daily, @weekly, @monthly), or rate(N minutes|hours|days). Cron is read in time_zone (default UTC). A function has at most 10 schedules.

    Idempotency: a retry with the same Idempotency-Key is not replayed: it adds another schedule. If a request may have gone through, list the schedules and delete the extra one.

    POST/public/v1/functions/{function_id}/schedules
    Write keyNeeds Idempotency-KeyReturns201Created

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    Body

    application/json
    • expressionstringrequired

      Five cron fields (minute hour day-of-month month day-of-week), @hourly, @daily, @weekly, @monthly, or rate(N minutes|hours|days). At most once a minute.

    • time_zonestring

      An IANA time zone cron is read in. Defaults to UTC.

    • descriptionstring

      A note for people, on one line.

      At most 200 characters.

    • inputobject

      Any JSON value, at most 8 KiB, passed to every run as the event's input.

    Response 201

    The schedule.
    • idstringrequired

      The schedule's id, starting fns_.

    • function_idstringrequired

      The function it calls.

    • expressionstringrequired

      Five cron fields, a shortcut such as @daily, or rate(N minutes|hours|days).

    • time_zonestringrequired

      The IANA time zone cron is read in.

    • descriptionstringrequired

      A note for people; empty when none.

    • inputobject | array | string | number | boolean or nullrequired

      JSON passed to every run as the event's input; null when none.

    • statestringrequired

      active runs on the timetable; paused does not.

      One of active, paused.

    • next_run_atstring or nullrequired

      When it runs next; null while paused.

    • last_run_atstring or nullrequired

      When the last run was due; null before the first.

    • last_outcomestring or nullrequired

      How the last run ended: ok, error, timeout or crashed as for any call; not_serving (no version was serving), suspended, throttled (at the concurrency limit), busy (no capacity), or failed (it could not be called). Null before the first run.

      One of ok, error, timeout, crashed, not_serving, suspended, throttled, busy, failed, null.

    • last_request_idstring or nullrequired

      The last run's request id, to find its logs; null when it did not reach the code.

    • created_atstringrequired

      When it was added.

    Errors

    • 400IDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing. Send a new unique value, such as a UUID, with every write. INVALID_IDEMPOTENCY_KEY: the Idempotency-Key header is longer than 255 characters. Use a shorter value. INVALID_REQUEST_BODY: the body is not a single valid JSON object. Send one JSON object with the fields documented for this endpoint.
    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps. FUNCTIONS_UNAVAILABLE: functions are not available to this organization. FUNCTION_SCHEDULE_LIMIT_REACHED: the function already has 10 schedules. Delete one first.
    • 404FUNCTION_NOT_FOUND: no function with this id exists in your organization. List your functions to find it.
    • 409ACCOUNT_SUSPENDED: the account has an overdue invoice. Pay it under Billing in the console, then try again. ACCOUNT_NOT_ACTIVE: billing setup is not finished. Finish it under Billing in the console, then try again.
    • 422VALIDATION_FAILED: a field is invalid. Each entry of errors names the field and its code: expression REQUIRED or INVALID: use five cron fields (minute hour day month weekday), a shortcut such as @daily, or rate(N minutes|hours|days); at most once a minute. time_zone INVALID: use an IANA time zone such as UTC or Africa/Lagos. description INVALID: use at most 200 characters on one line. input INVALID: use a JSON value of at most 8 KiB.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503FUNCTION_SCHEDULES_UNAVAILABLE: schedules cannot be read or changed right now. Retry shortly. QUOTA_UNAVAILABLE: the request quota could not be checked. Retry shortly.

    Every code is explained in Errors.

    Authorization
    Path
    Body
    Idempotency
    curl -X POST "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/schedules" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
        "expression": "expression"
      }'
    Response 201
    {
      "id": "fns_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "function_id": "function-id",
      "expression": "expression",
      "time_zone": "time-zone",
      "description": "description",
      "input": {},
      "state": "active",
      "next_run_at": "2026-10-03T09:30:00Z",
      "last_run_at": "2026-10-03T09:30:00Z",
      "last_outcome": "ok",
      "last_request_id": "last-request-id",
      "created_at": "2026-10-03T09:30:00Z"
    }

    Change a schedule

    Changes the fields sent and keeps the rest. state pauses (paused) or resumes (active) the schedule; a resumed schedule runs next at the next time its expression matches, not for the runs it missed while paused. input set to null removes it.

    PATCH/public/v1/functions/{function_id}/schedules/{schedule_id}
    Write keyNeeds Idempotency-KeyReturns200OK

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    • schedule_idstringrequired

      The schedule's id.

    Body

    application/json
    • expressionstring

      As when adding one.

    • time_zonestring

      As when adding one.

    • descriptionstring

      At most 200 characters.

    • inputobject

      Any JSON value, at most 8 KiB; null removes it.

    • statestring

      paused stops runs; active resumes them from the next match.

      One of active, paused.

    Response 200

    The schedule.
    • idstringrequired

      The schedule's id, starting fns_.

    • function_idstringrequired

      The function it calls.

    • expressionstringrequired

      Five cron fields, a shortcut such as @daily, or rate(N minutes|hours|days).

    • time_zonestringrequired

      The IANA time zone cron is read in.

    • descriptionstringrequired

      A note for people; empty when none.

    • inputobject | array | string | number | boolean or nullrequired

      JSON passed to every run as the event's input; null when none.

    • statestringrequired

      active runs on the timetable; paused does not.

      One of active, paused.

    • next_run_atstring or nullrequired

      When it runs next; null while paused.

    • last_run_atstring or nullrequired

      When the last run was due; null before the first.

    • last_outcomestring or nullrequired

      How the last run ended: ok, error, timeout or crashed as for any call; not_serving (no version was serving), suspended, throttled (at the concurrency limit), busy (no capacity), or failed (it could not be called). Null before the first run.

      One of ok, error, timeout, crashed, not_serving, suspended, throttled, busy, failed, null.

    • last_request_idstring or nullrequired

      The last run's request id, to find its logs; null when it did not reach the code.

    • created_atstringrequired

      When it was added.

    Errors

    • 400IDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing. Send a new unique value, such as a UUID, with every write. INVALID_IDEMPOTENCY_KEY: the Idempotency-Key header is longer than 255 characters. Use a shorter value. INVALID_REQUEST_BODY: the body is not a single valid JSON object. Send one JSON object with the fields documented for this endpoint.
    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps. FUNCTIONS_UNAVAILABLE: functions are not available to this organization.
    • 404FUNCTION_NOT_FOUND: no function with this id exists in your organization. List your functions to find it. FUNCTION_SCHEDULE_NOT_FOUND: the function has no schedule with this id. List its schedules to find it.
    • 409ACCOUNT_SUSPENDED: the account has an overdue invoice. Pay it under Billing in the console, then try again. ACCOUNT_NOT_ACTIVE: billing setup is not finished. Finish it under Billing in the console, then try again.
    • 422VALIDATION_FAILED: a field is invalid. Each entry of errors names the field and its code: expression REQUIRED or INVALID: use five cron fields (minute hour day month weekday), a shortcut such as @daily, or rate(N minutes|hours|days); at most once a minute. time_zone INVALID: use an IANA time zone such as UTC or Africa/Lagos. description INVALID: use at most 200 characters on one line. input INVALID: use a JSON value of at most 8 KiB. state INVALID: use active or paused.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503FUNCTION_SCHEDULES_UNAVAILABLE: schedules cannot be read or changed right now. Retry shortly. QUOTA_UNAVAILABLE: the request quota could not be checked. Retry shortly.

    Every code is explained in Errors.

    Authorization
    Path
    Body
    Idempotency
    curl -X PATCH "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/schedules/fns_06gk3x9tq7m2v8r4y1c5d0zp8w" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{}'
    Response 200
    {
      "id": "fns_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "function_id": "function-id",
      "expression": "expression",
      "time_zone": "time-zone",
      "description": "description",
      "input": {},
      "state": "active",
      "next_run_at": "2026-10-03T09:30:00Z",
      "last_run_at": "2026-10-03T09:30:00Z",
      "last_outcome": "ok",
      "last_request_id": "last-request-id",
      "created_at": "2026-10-03T09:30:00Z"
    }

    Delete a schedule

    Stops the schedule for good. A run already started finishes.

    Scope: write (an AI app's key also needs delete).

    DELETE/public/v1/functions/{function_id}/schedules/{schedule_id}
    Write keyNeeds Idempotency-KeyReturns204No Content

    Headers

    • Authorizationstringrequired

      Bearer and your API key: Bearer PAN_….

    • Idempotency-Keystringrequired

      A new value, such as a UUID, for each change. Resend with the same value to retry safely.

      At most 255 characters.

    Path parameters

    • function_idstringrequired

      The function's id.

    • schedule_idstringrequired

      The schedule's id.

    Response 204

    The schedule is deleted. No body.

    Errors

    • 400IDEMPOTENCY_KEY_REQUIRED: the Idempotency-Key header is missing. Send a new unique value, such as a UUID, with every write. INVALID_IDEMPOTENCY_KEY: the Idempotency-Key header is longer than 255 characters. Use a shorter value. INVALID_REQUEST_BODY: the body is not a single valid JSON object. Send one JSON object with the fields documented for this endpoint.
    • 401UNAUTHENTICATED: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send Authorization: Bearer PAN_… with a valid key; create one in the console under Organization › API keys.
    • 403INSUFFICIENT_SCOPE: the API key lacks the scope this endpoint needs. Use a key with that scope. FORBIDDEN: the member who created the key may not do this in the organization. Use a key created by an owner or admin. AI_APPS_DISABLED: the organization has turned AI app access off. An owner can turn it on in the console under Organization › AI apps.
    • 404FUNCTION_NOT_FOUND: no function with this id exists in your organization. List your functions to find it. FUNCTION_SCHEDULE_NOT_FOUND: the function has no schedule with this id. List its schedules to find it.
    • 429RATE_LIMITED: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait Retry-After seconds, then retry. For authenticated quota denials, RateLimit-Scope identifies the denying quota and RateLimit-Reset reports its remaining window in seconds.
    • 503FUNCTION_SCHEDULES_UNAVAILABLE: schedules cannot be read or changed right now. Retry shortly. QUOTA_UNAVAILABLE: the request quota could not be checked. Retry shortly.

    Every code is explained in Errors.

    Authorization
    Path
    Idempotency
    curl -X DELETE "https://api.pantechdynamics.com/public/v1/functions/id_06gk3x9tq7m2v8r4y1c5d0zp8w/schedules/fns_06gk3x9tq7m2v8r4y1c5d0zp8w" \
      -H "Authorization: Bearer $PANTECH_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)"
    HTTP/1.1 204 No Content

    Was this page helpful?

    Updated