n8n-docs/docs/api/openapi.yml
2022-06-01 19:09:49 -04:00

714 lines
20 KiB
YAML

openapi: 3.0.0
info:
title: n8n Public API
description: n8n Public API
termsOfService: 'https://n8n.io/legal/terms'
contact:
email: hello@n8n.io
license:
name: Sustainable Use License
url: 'https://github.com/n8n-io/n8n/blob/master/packages/cli/LICENSE.md'
version: 1.0.0
externalDocs:
description: n8n API documentation
url: 'https://docs.n8n.io/api/'
servers:
- url: /api/v1
tags:
- name: Execution
description: Operations about executions
- name: Workflow
description: Operations about workflows
- name: Credential
description: Operations about credentials
paths:
/credentials:
post:
x-eov-operation-id: createCredential
x-eov-operation-handler: v1/handlers/credentials/credentials.handler
tags:
- Credential
summary: Create a credential
description: Creates a credential that can be used by nodes of the specified type.
requestBody:
description: Credential to be created.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Credential'
responses:
'200':
description: Operation successful.
content:
application/json:
schema:
$ref: '#/components/schemas/Credential'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'415':
description: Unsupported media type.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/credentials/{id}':
delete:
x-eov-operation-id: deleteCredential
x-eov-operation-handler: v1/handlers/credentials/credentials.handler
tags:
- Credential
summary: Delete credential by ID
description: Deletes a credential from your instance. You must be the owner of the credentials
operationId: deleteCredential
parameters:
- name: id
in: path
description: The credential ID that needs to be deleted
required: true
schema:
type: number
responses:
'200':
description: Operation successful.
content:
application/json:
schema:
$ref: '#/components/schemas/Credential'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden. You are not allowed to delete this credential.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Credential not found
'/credentials/schema/{id}':
get:
x-eov-operation-id: getCredentialType
x-eov-operation-handler: v1/handlers/credentials/credentials.handler
tags:
- Credential
summary: Retrieve credential type by ID
parameters:
- name: id
in: path
description: The credential type ID that you need to retrive
required: true
schema:
type: string
responses:
'200':
description: Operation successful.
content:
application/json:
schema:
type: object
examples:
freshdeskApi:
value:
additionalProperties: false
type: object
properties:
apiKey:
type: string
domain:
type: string
required:
- apiKey
- domain
slackOAuth2Api:
value:
additionalProperties: false
type: object
properties:
clientId:
type: string
clientSecret:
type: string
required:
- clientId
- clientSecret
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Credential type not found
/executions:
get:
x-eov-operation-id: getExecutions
x-eov-operation-handler: v1/handlers/executions/executions.handler
tags:
- Execution
summary: Retrieve all executions
description: Retrieve all executions from your instance.
parameters:
- name: status
in: query
description: Status to filter the executions by.
required: false
schema:
type: string
enum:
- error
- success
- waiting
- name: workflowId
in: query
description: Workflow to filter the executions by.
required: false
schema:
type: number
example: 1000
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Cursor'
responses:
'200':
description: Operation successful.
content:
application/json:
schema:
$ref: '#/components/schemas/ExecutionList'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'/executions/{id}':
get:
x-eov-operation-id: getExecution
x-eov-operation-handler: v1/handlers/executions/executions.handler
tags:
- Execution
summary: Retrieve an execution
description: Retrieve an execution from you instance.
parameters:
- $ref: '#/components/parameters/ExecutionId'
responses:
'200':
description: Operation successful.
content:
application/json:
schema:
$ref: '#/components/schemas/Execution'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
delete:
x-eov-operation-id: deleteExecution
x-eov-operation-handler: v1/handlers/executions/executions.handler
tags:
- Execution
summary: Delete an execution
description: Deletes an execution from your instance.
parameters:
- $ref: '#/components/parameters/ExecutionId'
responses:
'200':
description: Operation successful.
content:
application/json:
schema:
$ref: '#/components/schemas/Execution'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
/workflows:
post:
x-eov-operation-id: createWorkflow
x-eov-operation-handler: v1/handlers/workflows/workflows.handler
tags:
- Workflow
summary: Create a workflow
description: Create a workflow in your instance.
requestBody:
description: Created workflow object.
content:
application/json:
schema:
$ref: '#/components/schemas/Workflow'
required: true
responses:
'200':
description: A workflow object
content:
application/json:
schema:
$ref: '#/components/schemas/Workflow'
'401':
$ref: '#/components/responses/Unauthorized'
get:
x-eov-operation-id: getWorkflows
x-eov-operation-handler: v1/handlers/workflows/workflows.handler
tags:
- Workflow
summary: Retrieve all workflows
description: Retrieve all workflows from your instance.
parameters:
- name: active
in: query
schema:
type: boolean
example: true
- name: tags
in: query
required: false
explode: false
schema:
type: string
example: 'test,production'
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Cursor'
responses:
'200':
description: Operation successful.
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowList'
'401':
$ref: '#/components/responses/Unauthorized'
'/workflows/{id}':
get:
x-eov-operation-id: getWorkflow
x-eov-operation-handler: v1/handlers/workflows/workflows.handler
tags:
- Workflow
summary: Retrive all workflows
description: Retrieve all workflows from your instance.
parameters:
- $ref: '#/components/parameters/WorkflowId'
responses:
'200':
description: Operation successful.
content:
application/json:
schema:
$ref: '#/components/schemas/Workflow'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
delete:
x-eov-operation-id: deleteWorkflow
x-eov-operation-handler: v1/handlers/workflows/workflows.handler
tags:
- Workflow
summary: Delete a workflow
description: Deletes a workflow from your instance.
parameters:
- $ref: '#/components/parameters/WorkflowId'
responses:
'200':
description: Operation successful.
content:
application/json:
schema:
$ref: '#/components/schemas/Workflow'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
put:
x-eov-operation-id: updateWorkflow
x-eov-operation-handler: v1/handlers/workflows/workflows.handler
tags:
- Workflow
summary: Update a workflow
description: Update a workflow.
parameters:
- $ref: '#/components/parameters/WorkflowId'
requestBody:
description: Updated workflow object.
content:
application/json:
schema:
$ref: '#/components/schemas/Workflow'
required: true
responses:
'200':
description: Workflow object
content:
application/json:
schema:
$ref: '#/components/schemas/Workflow'
'401':
$ref: '#/components/responses/Unauthorized'
'/workflows/{id}/activate':
post:
x-eov-operation-id: activateWorkflow
x-eov-operation-handler: v1/handlers/workflows/workflows.handler
tags:
- Workflow
summary: Activate a workflow
description: Active a workflow.
parameters:
- $ref: '#/components/parameters/WorkflowId'
responses:
'200':
description: Workflow object
content:
application/json:
schema:
$ref: '#/components/schemas/Workflow'
'401':
$ref: '#/components/responses/Unauthorized'
'/workflows/{id}/deactivate':
post:
x-eov-operation-id: deactivateWorkflow
x-eov-operation-handler: v1/handlers/workflows/workflows.handler
tags:
- Workflow
summary: Deactivate a workflow
description: Deactivate a workflow.
parameters:
- $ref: '#/components/parameters/WorkflowId'
responses:
'200':
description: Workflow object
content:
application/json:
schema:
$ref: '#/components/schemas/Workflow'
'401':
$ref: '#/components/responses/Unauthorized'
components:
schemas:
Error:
required:
- code
- description
- message
type: object
properties:
code:
type: string
message:
type: string
description:
type: string
Execution:
type: object
properties:
id:
type: number
example: 1000
data:
type: string
finished:
type: boolean
example: true
mode:
type: string
enum:
- cli
- error
- integrated
- internal
- manual
- retry
- trigger
- webhook
retryOf:
type: string
nullable: true
retrySuccessId:
type: string
nullable: true
example: 2
startedAt:
type: string
format: date-time
stoppedAt:
type: string
format: date-time
workflowId:
type: string
example: 1000
waitTill:
type: string
nullable: true
format: date-time
Node:
type: object
additionalProperties: false
properties:
name:
type: string
example: Jira
webhookId:
type: string
disabled:
type: boolean
notesInFlow:
type: boolean
notes:
type: string
type:
type: string
example: n8n-nodes-base.Jira
typeVersion:
type: number
example: 1
position:
type: array
items:
type: number
example:
- -100
- 80
parameters:
type: object
example:
additionalProperties: {}
credentials:
type: object
example:
jiraSoftwareCloudApi:
id: '35'
name: jiraApi
createdAt:
type: string
format: date-time
readOnly: true
updatedAt:
type: string
format: date-time
readOnly: true
Tag:
type: object
properties:
id:
type: string
example: 12
name:
type: string
example: Production
createdAt:
type: string
format: date-time
readOnly: true
updatedAt:
type: string
format: date-time
readOnly: true
Workflow:
type: object
required:
- name
- nodes
- connections
- settings
properties:
id:
type: number
readOnly: true
example: 1
name:
type: string
example: Workflow 1
active:
type: boolean
readOnly: true
createdAt:
type: string
format: date-time
readOnly: true
updatedAt:
type: string
format: date-time
readOnly: true
nodes:
type: array
items:
$ref: '#/components/schemas/Node'
connections:
type: object
example:
main:
- node: Jira
type: main
index: 0
settings:
$ref: '#/components/schemas/WorkflowSettings'
staticData:
type: string
nullable: true
example: '{ iterationId: 2 }'
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
readOnly: true
WorkflowSettings:
type: object
additionalProperties: false
properties:
saveExecutionProgress:
type: boolean
saveManualExecutions:
type: boolean
saveDataErrorExecution:
type: string
enum:
- all
- none
saveDataSuccessExecution:
type: string
enum:
- all
- none
executionTimeout:
type: number
example: 3600
maxLength: 3600
errorWorkflow:
type: string
example: 10
description: The ID of the workflow that contains the error trigger node.
timezone:
type: string
example: America/New_York
ExecutionList:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Execution'
nextCursor:
type: string
description: Paginate through executions by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection.
nullable: true
example: MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDA
WorkflowList:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Workflow'
nextCursor:
type: string
description: Paginate through workflows by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection.
nullable: true
example: MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDA
Credential:
required:
- name
- type
- data
type: object
properties:
id:
type: number
readOnly: true
example: 42
name:
type: string
example: Joe's Github Credentials
type:
type: string
example: github
data:
type: object
writeOnly: true
example:
token: ada612vad6fa5df4adf5a5dsf4389adsf76da7s
createdAt:
type: string
format: date-time
readOnly: true
example: '2022-04-29T11:02:29.842Z'
updatedAt:
type: string
format: date-time
readOnly: true
example: '2022-04-29T11:02:29.842Z'
CredentialType:
type: object
properties:
displayName:
type: string
readOnly: true
example: Email
name:
type: string
readOnly: true
example: email
type:
type: string
readOnly: true
example: string
default:
type: string
readOnly: true
example: string
responses:
NotFound:
description: The specified resource was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
Cursor:
name: cursor
in: query
description: Paginate through users by setting the cursor parameter to a nextCursor attribute returned by a previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail.
required: false
style: form
schema:
type: string
Limit:
name: limit
in: query
description: The maximum number of items to return.
required: false
schema:
type: number
example: 100
default: 100
maximum: 250
ExecutionId:
name: id
in: path
description: The ID of the execution.
required: true
schema:
type: number
WorkflowId:
name: id
in: path
description: The ID of the workflow.
required: true
schema:
type: number
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-N8N-API-KEY
security:
- ApiKeyAuth: []