{
  "openapi": "3.1.1",
  "info": {
    "title": "Indably API",
    "description": "Create, schedule and track social posts in Indably. Send \"Authorization: Bearer ind_…\" (Settings → API and webhooks). Send an Idempotency-Key header on writes so a retry can't make a second post. Times are UTC. Webhooks are signed: Indably-Signature: t=…,v1=HMAC-SHA256(secret, t + \".\" + body).",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://app.indably.com/"
    }
  ],
  "paths": {
    "/api/v1/me": {
      "get": {
        "tags": [
          "ApiV1"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiMe"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces": {
      "get": {
        "tags": [
          "ApiV1"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Workspace"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/connections": {
      "get": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Connection"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/media": {
      "post": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "altText",
            "in": "query",
            "schema": {
              "maxLength": 500,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/posts": {
      "post": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Post"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/posts/{postId}": {
      "get": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/posts/{postId}/submit": {
      "post": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/posts/{postId}/approve": {
      "post": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/posts/{postId}/send-back": {
      "post": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendBackRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendBackRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendBackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/posts/{postId}/schedule": {
      "post": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/posts/{postId}/unschedule": {
      "post": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/report": {
      "get": {
        "tags": [
          "ApiV1"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiReport"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiMe": {
        "required": [
          "keyId",
          "keyName",
          "account",
          "maxRole",
          "workspaces"
        ],
        "type": "object",
        "properties": {
          "keyId": {
            "type": "string",
            "format": "uuid"
          },
          "keyName": {
            "type": "string"
          },
          "account": {
            "type": "string"
          },
          "maxRole": {
            "type": "string"
          },
          "workspaces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Workspace"
            }
          }
        }
      },
      "ApiReport": {
        "required": [
          "from",
          "to",
          "totals",
          "posts"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "totals": {
            "$ref": "#/components/schemas/ReportTotals"
          },
          "posts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiReportRow"
            }
          }
        }
      },
      "ApiReportRow": {
        "required": [
          "publishedAt",
          "network",
          "account",
          "caption",
          "permalink",
          "views",
          "reach",
          "reactions",
          "comments",
          "shares",
          "saves",
          "clicks"
        ],
        "type": "object",
        "properties": {
          "publishedAt": {
            "type": "string",
            "format": "date-time"
          },
          "network": {
            "type": "string"
          },
          "account": {
            "type": "string"
          },
          "caption": {
            "type": "string"
          },
          "permalink": {
            "type": "string"
          },
          "views": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "reach": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "reactions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "comments": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "shares": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "saves": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "clicks": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "Connection": {
        "required": [
          "id",
          "network",
          "name",
          "handle",
          "mode",
          "health",
          "healthMessage"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "network": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "handle": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "health": {
            "type": "string"
          },
          "healthMessage": {
            "type": "string"
          }
        }
      },
      "CreatePostRequest": {
        "required": [
          "caption",
          "connections"
        ],
        "type": "object",
        "properties": {
          "caption": {
            "type": "string"
          },
          "connections": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "link": {
            "type": [
              "null",
              "string"
            ]
          },
          "firstComment": {
            "type": [
              "null",
              "string"
            ]
          },
          "utmCampaign": {
            "type": [
              "null",
              "string"
            ]
          },
          "media": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "captions": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "options": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/TargetOptions"
            }
          },
          "scheduleAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "queue": {
            "type": "boolean",
            "default": false
          },
          "submit": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "Media": {
        "required": [
          "id",
          "fileName",
          "kind",
          "bytes",
          "width",
          "height",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "fileName": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "bytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Metrics": {
        "required": [
          "capturedAt",
          "views",
          "reach",
          "reactions",
          "comments",
          "shares",
          "saves",
          "clicks"
        ],
        "type": "object",
        "properties": {
          "capturedAt": {
            "type": "string",
            "format": "date-time"
          },
          "views": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "reach": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "reactions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "comments": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "shares": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "saves": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "clicks": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "Post": {
        "required": [
          "id",
          "status",
          "caption",
          "link",
          "firstComment",
          "scheduledAt",
          "createdAt",
          "updatedAt",
          "reviewNote",
          "media",
          "targets"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "caption": {
            "type": "string"
          },
          "link": {
            "type": "string"
          },
          "firstComment": {
            "type": "string"
          },
          "scheduledAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "reviewNote": {
            "type": "string"
          },
          "media": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Target"
            }
          }
        }
      },
      "ReportTotals": {
        "required": [
          "posts",
          "views",
          "reach",
          "reactions",
          "comments",
          "shares",
          "saves",
          "clicks"
        ],
        "type": "object",
        "properties": {
          "posts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "views": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "reach": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "reactions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "comments": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "shares": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "saves": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "clicks": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "ScheduleRequest": {
        "type": "object",
        "properties": {
          "at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "queue": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "SendBackRequest": {
        "required": [
          "note"
        ],
        "type": "object",
        "properties": {
          "note": {
            "type": "string"
          }
        }
      },
      "Target": {
        "required": [
          "id",
          "connectionId",
          "network",
          "account",
          "status",
          "mode",
          "caption",
          "publishedAt",
          "permalink",
          "error",
          "errorCode",
          "metrics"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "network": {
            "type": "string"
          },
          "account": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "caption": {
            "type": "string"
          },
          "publishedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "permalink": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "errorCode": {
            "type": "string"
          },
          "metrics": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Metrics"
              }
            ]
          }
        }
      },
      "TargetOptions": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "privacy": {
            "type": "string"
          },
          "allowComments": {
            "type": "boolean"
          },
          "discloses": {
            "type": "boolean"
          },
          "allowDuet": {
            "type": "boolean"
          },
          "allowStitch": {
            "type": "boolean"
          },
          "promotesOwnBrand": {
            "type": "boolean"
          },
          "brandedContent": {
            "type": "boolean"
          },
          "madeForKids": {
            "type": "boolean"
          },
          "button": {
            "type": "string"
          }
        }
      },
      "Workspace": {
        "required": [
          "id",
          "name",
          "timeZone",
          "requireApproval",
          "role"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "timeZone": {
            "type": "string"
          },
          "requireApproval": {
            "type": "boolean"
          },
          "role": {
            "type": "string"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "ApiV1"
    }
  ]
}