API v1 / Documents

A guide for using the Documents Router in API v1.

API v1 Documentation: Documents Router

This guide provides a comprehensive overview of the Documents Router in API v1, which allows for managing documents within the platform. The router supports standard CRUD operations and provides flexibility through subhandlers and middleware.


Authentication Details

To obtain the API key, follow these steps:

  1. Go to the "Integrations" tab in the platform.
  2. Create a new integration of the provider integrationsProvider/api.
  3. Upon creation, you will receive the token.
  4. Tokens can also be deleted or regenerated through this interface.

Make sure to securely store the token. Include it in the Authorization header for all requests.

Example Authorization Header:

Authorization: Bearer <API_KEY>

API Overview

Base Endpoint

https://api.flows.synergyshock.com/v1/documents/{{documentPath}}

Available HTTP Methods

MethodPurpose

Authentication Required

GETRetrieve document dataYes
POSTCreate a new documentYes
PATCHUpdate an existing documentYes
DELETERemove a documentYes

Parameter Details

The {{documentPath}} is the way to locate a document in our platform. Examples include:

  • /organizations/{{organizationId}}/pipelinesProjects/{{projectId}}
  • /organizations/{{organizationId}}/pipelinesLabels/{{pipelineLabelId}}
  • /organizations/{{organizationId}}/pipelinesPacketsLabels/{{pipelinePacketLabelId}}

Route Handlers

GET Handler

Retrieves the specified document's data.

Request Example:

GET /api/v1/documents/organizations/iDx5yLKl1cCcq0lqiBw4/pipelinesProjects/s6v6DWIITYnZqTpT2SSe
Authorization: Bearer <API_KEY>

Response Example:

{
  "entityId": "s6v6DWIITYnZqTpT2SSe",
  "entityKey": "pipelinesProjects",
  "entityPath": "organizations/iDx5yLKl1cCcq0lqiBw4/pipelinesProjects/s6v6DWIITYnZqTpT2SSe",
  "collectionPath": "organizations/iDx5yLKl1cCcq0lqiBw4/pipelinesProjects",
  "organizationId": "iDx5yLKl1cCcq0lqiBw4",
  "data": {
    "name": "The Drone Project",
    "softRemoved": false,
    "createdBy": "cw9RmVGT0Laajp9IslVFdBrCmy43",
    "createdAt": {
      "_seconds": 1733516420,
      "_nanoseconds": 494000000
    }
  }
}

POST Handler

Creates a new document in the specified path.

Request Example:

POST /api/v1/documents/organizations/iDx5yLKl1cCcq0lqiBw4/pipelinesProjects
Authorization: Bearer <API_KEY>
Content-Type: application/json

{
  "name": "New project created 01",
  "color": "#FAFAFA",
  "description": "test description"
}

Response Example:

{
  "entityId": "ad0RmVGFRD0aajp9IslVFdBrCmy43",
  "entityKey": "pipelinesProjects",
  "entityPath": "organizations/iDx5yLKl1cCcq0lqiBw4/pipelinesProjects/ad0RmVGFRD0aajp9IslVFdBrCmy43",
  "collectionPath": "organizations/iDx5yLKl1cCcq0lqiBw4/pipelinesProjects",
  "organizationId": "iDx5yLKl1cCcq0lqiBw4",
  "data": {
    "name": "New project created 01",
    "description": "test description",
    "color": "#FAFAFA",
    "createdAt": {
      "_seconds": 1733832890,
      "_nanoseconds": 631000000
    },
    "updatedAt": {
      "_seconds": 1733832890,
      "_nanoseconds": 631000000
    },
    "softRemoved": false
  }
}

PATCH Handler

Updates an existing document.

Request Example:

PATCH /api/v1/documents/organizations/iDx5yLKl1cCcq0lqiBw4/pipelinesProjects/s6v6DWIITYnZqTpT2SSe
Authorization: Bearer <API_KEY>
Content-Type: application/json

{
  "name": "Updated project name"
}

Response Example:

{
  "entityId": "s6v6DWIITYnZqTpT2SSe",
  "entityKey": "pipelinesProjects",
  "entityPath": "organizations/iDx5yLKl1cCcq0lqiBw4/pipelinesProjects/s6v6DWIITYnZqTpT2SSe",
  "collectionPath": "organizations/iDx5yLKl1cCcq0lqiBw4/pipelinesProjects",
  "organizationId": "iDx5yLKl1cCcq0lqiBw4",
  "data": {
    "name": "Updated project name",
    "updatedAt": {
      "_seconds": 1733832990,
      "_nanoseconds": 644000000
    }
  }
}

DELETE Handler

Deletes a document at the specified path.

Request Example:

DELETE /api/v1/documents/organizations/iDx5yLKl1cCcq0lqiBw4/pipelinesProjects/1
Authorization: Bearer <API_KEY>

Response Example:

{
  "success": true
}

Error Handling

Error CodeDescription

Possible Cause

401UnauthorizedMissing or invalid API token
403ForbiddenAccess to resource is denied
404Document Not Found

Specified document does not exist

500Internal Server Error

Unexpected error during processing