Skip to main content
GET
/
v1
/
{workspace}
/
schema
/
{schema_slug}
/
Get Schema
curl -X GET "https://management-api.suprsend.com/v1/{workspace}/schema/{schema_slug}/" \
  --header 'Authorization: ServiceToken <token>' \
  --header 'Content-Type: application/json'
import requests

url = "https://management-api.suprsend.com/v1/{workspace}/schema/{schema_slug}/"

headers = {"ServiceToken <token>": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'ServiceToken <token>': '<api-key>'}};

fetch('https://management-api.suprsend.com/v1/{workspace}/schema/{schema_slug}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://management-api.suprsend.com/v1/{workspace}/schema/{schema_slug}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"ServiceToken <token>: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://management-api.suprsend.com/v1/{workspace}/schema/{schema_slug}/"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("ServiceToken <token>", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://management-api.suprsend.com/v1/{workspace}/schema/{schema_slug}/")
.header("ServiceToken <token>", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://management-api.suprsend.com/v1/{workspace}/schema/{schema_slug}/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["ServiceToken <token>"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "slug": "new-order-placed",
  "name": "Order Placed Event",
  "description": "Schema for order placement action",
  "status": "draft",
  "hash": "382b707d4b1f8999a1xxxxxxxx",
  "json_schema": {
    "type": "object",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "required": [
      "order_id",
      "amount"
    ],
    "properties": {
      "order_id": {
        "type": "string"
      },
      "amount": {
        "type": "string"
      }
    },
    "additionalProperties": true
  },
  "created_at": "2025-08-27T09:30:57.945326Z",
  "updated_at": "2025-08-29T15:37:37.650177Z",
  "committed_at": null,
  "commit_message": null
}
{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}
{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "workspace 'staging4' not found",
"detail": "workspace 'staging4' not found"
}

Authorizations

ServiceToken <token>
string
header
required

You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.

Path Parameters

workspace
string
required

Workspace slug (staging, production, etc.)

schema_slug
string
required

Unique identifier of the schema

Query Parameters

mode
enum<string>
default:draft

Mode to fetch schema (draft or live). By default, draft schema is returned.

Available options:
draft,
live

Response

Successfully retrieved schema object

slug
string

Unique identifier for the schema

Example:

"new-order-placed"

name
string

Human-readable name of the schema

Example:

"Order Placed Event"

description
string | null

Description of the schema

Example:

"Schema for order placement action"

status
enum<string>

Status of returned schema. By default, draft version is returned. You can set mode=live to fetch the live schema.

Available options:
draft,
live
Example:

"draft"

hash
string

Git-like hash for version tracking

Example:

"382b707d4b1f8999a1xxxxxxxx"

json_schema
object | null

Structure of the workflow or event payload. Follows standard json schema specification. You can link this schema to a workflow or event to validate their input payload in API response. Same schema can be linked to multiple workflows and events.

Example:
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": ["order_id", "amount"],
"properties": {
"order_id": { "type": "string" },
"amount": { "type": "string" }
},
"additionalProperties": true
}
created_at
string<date-time>

When the schema was created

Example:

"2025-08-27T09:30:57.945326Z"

updated_at
string<date-time>

When the schema was last updated

Example:

"2025-08-29T15:37:37.650177Z"

committed_at
string<date-time> | null

When the schema was last committed. Only available for live schema.

Example:

null

commit_message
string | null

Last commit message. Only available for live schema.

Example:

null