Versions

SDK platic.tools.functions.versions()
SDK platic.tools.functions.versions()

Each publication creates a fixed version with the code, domains, time limit, and secret slots from that moment. liveVersion identifies the version agents use.

Example

await platic.tools.functions.versions("fn_123");

await platic.tools.functions.versions("fn_123", 1);

List versions

The published versions, newest to oldest, without their code.

Path parameters

ParameterTypeDescriptionRequired
functionIdstringFunction ID✓

Response

{
  "status": "success",
  "data": [
    {
      "version": 2,
      "checksum": "sha256-9b07e2…",
      "inputSchema": {
        "type": "object",
        "properties": { "taxId": { "type": "string", "description": "Customer tax ID, 12 or 13 characters" } },
        "required": ["taxId"]
      },
      "allowedDomains": ["api.example.com"],
      "timeoutSeconds": 30,
      "secretSlots": [{ "slot": "API_KEY", "origin": "https://api.example.com" }],
      "publishedAt": "2026-11-25T10:12:00.000Z",
      "publishedBy": "user:8sKd2LxQp0",
      "notes": "Also returns whether the tax ID is active"
    },
    {
      "version": 1,
      "checksum": "sha256-3f1c9a…",
      "allowedDomains": ["api.example.com"],
      "timeoutSeconds": 20,
      "secretSlots": [{ "slot": "API_KEY", "origin": "https://api.example.com" }],
      "publishedAt": "2026-11-24T18:01:00.000Z",
      "publishedBy": "user:8sKd2LxQp0",
      "notes": "First version"
    }
  ]
}

Get a version

A published version, with its code in source.

Path parameters

ParameterTypeDescriptionRequired
functionIdstringFunction ID✓
versionintegerThe version's number, starting at 1✓

Response

data has the list's fields and also source.

{
  "status": "success",
  "data": {
    "version": 1,
    "checksum": "sha256-3f1c9a…",
    "allowedDomains": ["api.example.com"],
    "timeoutSeconds": 20,
    "secretSlots": [{ "slot": "API_KEY", "origin": "https://api.example.com" }],
    "publishedAt": "2026-11-24T18:01:00.000Z",
    "publishedBy": "user:8sKd2LxQp0",
    "notes": "First version",
    "source": "import { z } from \"zod\";\nimport { defineFunction } from \"@platica/functions\";\n\nexport default defineFunction({ … });\n"
  }
}

Response fields

FieldTypeDescription
versionintegerThe version's number
checksumstringFingerprint of the published code
inputSchemaobjectThe JSON Schema agents saw with this version
allowedDomainsstring[]This version's allowed domains
timeoutSecondsintegerThis version's maximum time
secretSlotsarrayThis version's { slot, origin } slots
publishedAtstringISO 8601 date of the publication
publishedBystringWho published it: api:<keyId> or user:<uid>
notesstringThe publication's notes
sourcestringThe code. Only when you get a version

Errors

Statusdetails.codeWhen
400INVALID_REQUESTversion is not a positive integer
403FORBIDDENThe person behind the token does not have access to Integrations
404NOT_FOUNDThe function or the version does not exist

Notes

  • To put an earlier version live, use Go back to a version.
  • A function that has never been published returns an empty list.