Clearstory Attachments API
The Attachments API from Clearstory, for attachments.
The Attachments API from Clearstory, for attachments.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/extracker:extracker-attachments-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Clearstory Web Attachments API
version: 1.9.0
host: web-api.clearstory.build
description: 'The Clearstory Web API allows you to access and build your own applications that utilize your Clearstory data. The Clearstory Web API provides a RESTful interface with JSON-formatted responses to access many Clearstory resources. Check back here for more information as we continue to expanding our API functionality.
Web API domain: `https://web-api.clearstory.build`'
x-logo:
url: https://www.clearstory.build/hubfs/CS_Logo_Landscape_Color_1200x400.svg
backgroundColor: '#FFFFFF'
altText: Clearstory
servers:
- url: https://web-api.clearstory.build/
tags:
- name: Attachments
paths:
/attachments:
post:
operationId: CreateAttachment
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAttachmentResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedErrorResponse'
examples:
Example 1:
value:
message: Unauthorized
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponseJSON'
examples:
Example 1:
value:
message: The given draft COR does not exist or does not belong to your company.
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponseJSON'
examples:
Example 1:
value:
message: Something went wrong
description: 'Creates a new attachment by uploading a file to S3 storage.
Send the request as `multipart/form-data`. The `file` part must come last,
after the `attachableType`, `attachmentType`, and `attachableId` text
fields. If `file` is sent first, the request fails with `400 Bad Request`
("Invalid attachment type") because the text fields are read as the request
streams in and are not yet available when the file is validated.'
tags:
- Attachments
security:
- ClearstoryAPIKey: []
parameters: []
requestBody:
description: '- The attachment creation parameters including file data and metadata'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAttachmentParams'
description: '- The attachment creation parameters including file data and metadata'
summary: Create attachment
x-summary-source: derived
x-operation-id-source: normalized
x-operation-id-original: Create Attachment
components:
schemas:
CreatedAttachment:
properties:
id:
type: number
format: double
attachableId:
type: number
format: double
companyId:
type: number
format: double
fileName:
type: string
attachableType:
type: string
attachmentType:
type: string
fileContentType:
type: string
fileSize:
type: number
format: double
signedUrl:
type: string
required:
- id
- companyId
- fileName
- attachableType
- attachmentType
- fileContentType
- fileSize
type: object
additionalProperties: false
AttachableType:
enum:
- tm_tags
- change_notifications
- cors
type: string
UnauthorizedErrorResponse:
properties:
message:
type: string
type: object
additionalProperties: false
AttachmentType:
enum:
- pdf
- image
type: string
CreateAttachmentResponse:
properties:
status:
type: number
enum:
- 201
success:
type: boolean
enum:
- true
data:
$ref: '#/components/schemas/CreatedAttachment'
required:
- status
- success
- data
type: object
additionalProperties: false
CreateAttachmentParams:
description: 'Parameters required for creating a new attachment.
Send this request as multipart form data. The storage metadata for the file
is created by Clearstory at upload time and should not be supplied.
Important: the `file` part must be sent last, after all of the text fields.
The upload is read from top to bottom and the file is validated the moment it
is reached, so `attachableType`, `attachmentType`, and `attachableId` must
appear before `file`. If `file` is sent first, the request fails with a
`400 Bad Request` ("Invalid attachment type") because the text fields have
not been read yet.
Example form data (in this order):
- attachableType: cors
- attachmentType: pdf
- attachableId: 1714190
- file: COR-32.pdf'
properties:
attachableType:
$ref: '#/components/schemas/AttachableType'
description: 'The type of entity this attachment will be associated with.
Example: cors'
attachmentType:
$ref: '#/components/schemas/AttachmentType'
description: 'The category/type of the attachment being uploaded.
Example: pdf'
attachableId:
type: number
format: double
description: 'The ID of the entity this attachment will be associated with.
Required when attaching a file to a draft Change Order Request. For COR
attachments, this must be a positive COR ID for a COR that exists, belongs
to your company, and is still a draft.'
file:
type: string
description: 'The file to upload. Select a PDF when `attachmentType` is `pdf`, or a JPEG
or PNG when `attachmentType` is `image`.
This must be the last part in the multipart form data, after all of the
text fields above. If it is sent first, the request fails with
`400 Bad Request` ("Invalid attachment type").'
format: binary
required:
- attachableType
- attachmentType
- file
type: object
additionalProperties: false
ErrorResponseJSON:
properties:
message:
type: string
type: object
additionalProperties: false
securitySchemes:
ClearstoryAPIKey:
type: http
scheme: basic
in: header
name: Authorization
description: 'The Web API currently uses Basic Auth where the username is the _Key ID_ and password is the _Key Secret._ **These API keys provide access to your data at a company level.**
There is a limit to the number of API keys a given company can have generated and active at any given time. Keys can be disabled and created again.
It is important to note the _Secret Key_ value cannot be retrieved again. Should you lose it, you will need to generate a new API key.
Basic Auth works simply by including an `Authorization` header with a base64 encoded string value that combines your _**Key ID**_ and _**Key Secret**_ separated by a colon. ie. `476B2524694742F2B2ACA15ACE3518C9:112cd32ec0d015fe9c5709d14cef3201`.
Your final header should look something like: `Authorization: Basic YWRzZmFkZmFrZmpoM2sybGpma3dhMw==`'