Discovery needs no key. Ratings and market analysis are Pro.
Get an API 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. See our Privacy Policy and
Terms.
openapi: 3.2.0
info:
description: Coderd is the service created by running coder server. It is a thin API that connects workspaces, provisioners and users. coderd stores its state in Postgres and is the only service that communicates with Postgres.
title: Coder Files API
termsOfService: https://coder.com/legal/terms-of-service
contact:
name: API Support
url: https://coder.com
email: support@coder.com
license:
name: AGPL-3.0
url: https://github.com/coder/coder/blob/main/LICENSE
version: '2.0'
servers:
- url: /
tags:
- name: Files
paths:
/api/v2/files:
post:
description: 'Swagger notice: Swagger 2.0 doesn''t support file upload with a `content-type` different than `application/x-www-form-urlencoded`.'
tags:
- Files
summary: Upload file
operationId: upload-file
parameters:
- description: Content-Type must be `application/x-tar` or `application/zip`
name: Content-Type
in: header
required: true
schema:
type: string
default: application/x-tar
responses:
'200':
description: Returns existing file if duplicate
content:
application/json:
schema:
$ref: '#/components/schemas/codersdk.UploadResponse'
'201':
description: Returns newly created file
content:
application/json:
schema:
$ref: '#/components/schemas/codersdk.UploadResponse'
'413':
description: Request body exceeds 100 MiB, or a .zip archive exceeds it once expanded
content:
application/json:
schema:
$ref: '#/components/schemas/codersdk.Response'
security:
- CoderSessionToken: []
requestBody:
content:
application/x-tar:
schema:
type: object
properties:
file:
type: string
description: File to be uploaded. If using tar format, file must conform to ustar (pax may cause problems).
format: binary
required:
- file
/api/v2/files/{fileID}:
get:
tags:
- Files
summary: Get file by ID
operationId: get-file-by-id
parameters:
- description: File ID
name: fileID
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: OK
security:
- CoderSessionToken: []
components:
schemas:
codersdk.UploadResponse:
type: object
properties:
hash:
type: string
format: uuid
codersdk.Response:
type: object
properties:
detail:
description: 'Detail is a debug message that provides further insight into why the
action failed. This information can be technical and a regular golang
err.Error() text.
- "database: too many open connections"
- "stat: too many open files"'
type: string
message:
description: 'Message is an actionable message that depicts actions the request took.
These messages should be fully formed sentences with proper punctuation.
Examples:
- "A user has been created."
- "Failed to create a user."'
type: string
validations:
description: 'Validations are form field-specific friendly error messages. They will be
shown on a form field in the UI. These can also be used to add additional
context if there is a set of errors in the primary ''Message''.'
type: array
items:
$ref: '#/components/schemas/codersdk.ValidationError'
codersdk.ValidationError:
type: object
required:
- detail
- field
properties:
detail:
type: string
field:
type: string
securitySchemes:
AIGatewayKey:
type: apiKey
name: X-AI-Governance-Gateway-Key
in: header
Authorization:
type: apiKey
name: Authorization
in: header
CoderSessionToken:
type: apiKey
name: Coder-Session-Token
in: header
x-provenance:
method: harvested
publisher: Coder
source: https://raw.githubusercontent.com/coder/coder/main/coderd/apidoc/swagger.json
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)