Approvals

Embed
Preview of the card
<a href="https://indrava.forumulate.com/docs/ref-approvals"><img src="https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/pages/3cc60d89-781a-45e1-8589-2eee45aff252/social-card.svg?v=3e7ae33eec8b" alt="Approvals" width="600" height="315"></a>
POST http://localhost:4000/api/v1/posts/{postId}/submit

Submit a draft: for approval, or straight to the calendar when none is needed

With several workflows, workflowId picks one. Where approval is optional, requestApproval: true asks for it; without it the post is scheduled directly.

Parameters

postId
string
path
required

Request body

application/json
assigneeIds
string[]
workflowId
string
requestApproval
boolean
{
  "assigneeIds": [
    "string"
  ],
  "workflowId": "string",
  "requestApproval": true
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/posts/{postId}/submit" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"assigneeIds":["string"],"workflowId":"string","requestApproval":true}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/posts/submissions

Submit up to 100 drafts for approval in one call

Each entry of the answer is ok: true with the post's new status, or ok: false with the error POST /posts/{postId}/submit would have answered.

Request body

application/json
postIds
string[]
required
workflowId
string
requestApproval
boolean
{
  "postIds": [
    "string"
  ],
  "workflowId": "string",
  "requestApproval": true
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/posts/submissions" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"postIds":["string"],"workflowId":"string","requestApproval":true}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/approvals/{postId}/decision

Approve or reject a post that is awaiting approval

Parameters

postId
string
path
required

Request body

application/json
decision
string
required
approved | rejected
comment
string
{
  "decision": "approved",
  "comment": "string"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/approvals/{postId}/decision" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"decision":"approved","comment":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/approvals/decisions

Approve or reject up to 100 posts at once

comment is the one note for all of them and is required when rejecting. The answer has one result per post, in order: ok: true with the outcome, or ok: false with the error POST /approvals/{postId}/decision would have answered.

Request body

application/json
postIds
string[]
required
decision
string
required
approved | rejected
comment
string
{
  "postIds": [
    "string"
  ],
  "decision": "approved",
  "comment": "string"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/approvals/decisions" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"postIds":["string"],"decision":"approved","comment":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
POST http://localhost:4000/api/v1/posts/{postId}/withdraw

Take a post back from approval: it becomes a draft again

Parameters

postId
string
path
required

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/posts/{postId}/withdraw" \
  -H "Authorization: Bearer $API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
GET http://localhost:4000/api/v1/approvals

List approval requests (pending ones unless `status` says otherwise)

Parameters

status
string
query
pending | approved | rejected | withdrawn
postId
string
query
approverId
string
query
clientId
string
query
step
integer
query

Code samples

cURL
curl -X GET "http://localhost:4000/api/v1/approvals" \
  -H "Authorization: Bearer $API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
[
  {
    "id": "string",
    "organizationId": "string",
    "postId": "string",
    "requestedBy": "string",
    "mode": "none",
    "assigneeIds": {},
    "status": "pending",
    "createdAt": "2024-01-01T00:00:00Z",
    "decidedAt": "2024-01-01T00:00:00Z",
    "workflowId": "string",
    "steps": {},
    "step": 0,
    "policy": "string",
    "graceHours": 0,
    "remindedDayAt": "2024-01-01T00:00:00Z",
    "remindedSoonAt": "2024-01-01T00:00:00Z",
    "clientId": "string",
    "decisions": [
      {
        "id": "string",
        "organizationId": "string",
        "requestId": "string",
        "actorKind": "member",
        "actorId": "string",
        "actorName": "string",
        "decision": "approved",
        "comment": "string",
        "step": 0,
        "elsewhere": true,
        "createdAt": "2024-01-01T00:00:00Z"
      }
    ]
  }
]
Schema
id
string
required
organizationId
string
required
postId
string
required
requestedBy
string
required
mode
string
required
none | one | all
assigneeIds
required
status
string
required
pending | approved | rejected | withdrawn
createdAt
string
required
decidedAt
string
required
workflowId
string
required
steps
required
step
number
required
policy
string
required
graceHours
number
required
remindedDayAt
string
required
remindedSoonAt
string
required
clientId
string
required
decisions
object[]
required
Show child parameters
id
string
required
organizationId
string
required
requestId
string
required
actorKind
string
required
member | reviewer
actorId
string
required
actorName
string
required
decision
string
required
approved | rejected
comment
string
required
step
number
required
elsewhere
boolean
required
createdAt
string
required
Updated