API reference

Documents

Generate content from a template and fetch the result.

Generate a document

POST api.app.typetone.ai/public/v1/document

Generates content from a template. input is a JSON string with the fields the template asks for; get them from the template endpoints.

Authorization

  • X-API-Keyheaderrequired

    Your workspace API key.

Request body

  • templateIdstringrequired

    ID of the template, from List templates.

  • language_keystringrequired

    Language to write in, for example EN or NL.

    One ofNLENESITGRSEPTFRFIPLDETRDKRUNO

  • inputstringrequired

    The input passed to the template parameters. Which fields should be added depends per template, and can be queried from the /template endpoint

  • toneOfVoiceMetaIdstring | null

    Optional tone of voice to write in, from the tone of voice endpoints.

Response · 201

  • messagestringrequired

    Status message.

  • documentIdstringrequired

    ID of the generated document. Fetch it with Get a document.

Errors

  • 401 Missing or invalid API key.
  • 403 The workspace is not on a plan with API access.
  • 404 The resource does not exist in this workspace.
  • 422 A parameter or the request body is invalid. detail says which.
curl -X POST "https://api.app.typetone.ai/public/v1/document" \
  -H "X-API-Key: $TYPETONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "cmuf2k8x10001ab12cd34ef56",
    "language_key": "NL",
    "input": "{\"text\":\"The benefits of AI in software development\",\"tone\":\"Professional yet approachable\"}",
    "toneOfVoiceMetaId": "cmuf2k8x10001ab12cd34ef56"
  }'
Response · 201
{
  "message": "string",
  "documentId": "cmuf2k8x10001ab12cd34ef56"
}

Get a document

GET api.app.typetone.ai/public/v1/document/{id}

Authorization

  • X-API-Keyheaderrequired

    Your workspace API key.

Path parameters

  • idstringrequired

    Unique ID.

Response · 200

  • idstringrequired

    Unique ID.

  • titlestringrequired
  • sharedbooleanrequired
  • documentarray of object | null
  • rawDocumentstringrequired
  • generatedOutputstringrequired
  • bulkInputIdstring | null
  • languageKeystring | null

    One ofNLENESITGRSEPTFRFIPLDETRDKRUNO

  • templateIdstring | null

    ID of the template, from List templates.

  • toneOfVoiceIdstring | null

Errors

  • 401 Missing or invalid API key.
  • 403 The workspace is not on a plan with API access.
  • 404 The resource does not exist in this workspace.
  • 422 A parameter or the request body is invalid. detail says which.
curl "https://api.app.typetone.ai/public/v1/document/cmuf2k8x10001ab12cd34ef56" \
  -H "X-API-Key: $TYPETONE_API_KEY"
Response · 200
{
  "id": "cmuf2k8x10001ab12cd34ef56",
  "title": "string",
  "shared": true,
  "document": [
    {}
  ],
  "rawDocument": "string",
  "generatedOutput": "string",
  "bulkInputId": "cmuf2k8x10001ab12cd34ef56",
  "languageKey": "NL",
  "templateId": "cmuf2k8x10001ab12cd34ef56",
  "toneOfVoiceId": "cmuf2k8x10001ab12cd34ef56"
}

Something unclear or missing? Tell us and we'll improve this page.

Developers
Esc