{ "openapi": "3.0.0", "paths": { "/v2/traces": { "post": { "description": "Creates a new trace", "operationId": "TraceV2Controller_createTrace", "parameters": [], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "traceInput": { "type": "object", "description": "This is the form data of the link" }, "actionKey": { "type": "string", "description": "The label of the action" }, "workflowId": { "type": "string", "description": "The UUID of the workflow" }, "groupLabel": { "type": "string", "description": "The label of the group performing the action" }, "file_example": { "type": "string", "format": "binary" }, "other_file_example": { "type": "string", "format": "binary" } } } } } }, "responses": { "default": { "description": "The ID of the created trace", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTraceV2Dto" } } } } }, "security": [ { "bearer": [] } ], "summary": "Create a new trace", "tags": [ "Trace" ] } }, "/v2/traces/{traceId}/action": { "post": { "description": "Appends a new action to a given trace by id", "operationId": "TraceV2Controller_addLink", "parameters": [ { "name": "traceId", "required": true, "in": "path", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "traceInput": { "type": "object", "description": "This is the form data of the link" }, "actionKey": { "type": "string", "description": "The label of the action" }, "workflowId": { "type": "string", "description": "The UUID of the workflow" }, "groupLabel": { "type": "string", "description": "The label of the group performing the action" }, "file_example": { "type": "string", "format": "binary" }, "other_file_example": { "type": "string", "format": "binary" } } } } } }, "responses": { "default": { "description": "The updated trace", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTraceV2Dto" } } } } }, "security": [ { "bearer": [] } ], "summary": "New action", "tags": [ "Trace" ] } }, "/v2/traces/{traceId}/state": { "get": { "description": "Retrieves the state of a given trace by id", "operationId": "TraceV2Controller_getTraceState", "parameters": [ { "name": "traceId", "required": true, "in": "path", "description": "The UUID of the trace", "schema": { "type": "string" } } ], "responses": { "200": { "description": "The state of the given trace", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetTraceStateV2Dto" } } } } }, "security": [ { "bearer": [] } ], "summary": "Retrieve trace state", "tags": [ "Trace" ] } }, "/v2/traces/{traceId}/details": { "post": { "description": "Retrieves the details of a given trace by id", "operationId": "TraceV2Controller_getTraceDetails", "parameters": [ { "name": "traceId", "required": true, "in": "path", "description": "The UUID of the trace", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TraceDetailsInputV2Dto" } } } }, "responses": { "200": { "description": "The details of the given trace", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetTraceDetailsV2Dto" } } } } }, "security": [ { "bearer": [] } ], "summary": "Retrieve trace details", "tags": [ "Trace" ] } }, "/v2/traces/{traceId}/file/{digest}": { "get": { "description": "Downloads a file from a given trace by id and digest", "operationId": "TraceV2Controller_getFileFromTrace", "parameters": [ { "name": "traceId", "required": true, "in": "path", "description": "The UUID of the trace", "schema": { "type": "string" } }, { "name": "digest", "required": true, "in": "path", "description": "The digest", "schema": { "type": "string" } } ], "responses": { "200": { "description": "The file downloaded from the given trace" } }, "security": [ { "bearer": [] } ], "summary": "Download a file", "tags": [ "Trace" ] } }, "/v2/traces/{traceId}/files": { "get": { "description": "Downloads multiple files from a given trace by id and digests", "operationId": "TraceV2Controller_getFilesFromTrace", "parameters": [ { "name": "traceId", "required": true, "in": "path", "description": "The UUID of the trace", "schema": { "type": "string" } }, { "name": "digests", "required": true, "in": "query", "description": "The list of digests of the files to download. All the files need to be in the trace", "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "The files downloaded from the given trace in a zip archive" } }, "security": [ { "bearer": [] } ], "summary": "Download files", "tags": [ "Trace" ] } }, "/v2/login/privateKey": { "post": { "description": "Login using a private key of a valid Stratumn user", "operationId": "LoginControllerV2_loginPrivateKey", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginPrivateKeyDto" } } } }, "responses": { "200": { "description": "The jwt auth token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenV2Dto" } } } } }, "summary": "Login using a private key", "tags": [ "Login" ] } }, "/v2/login/credential": { "post": { "deprecated": true, "description": "Login using the email and the password of a valid Stratumn user", "operationId": "LoginControllerV2_loginCredential", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginCredentialDto" } } } }, "responses": { "200": { "description": "The jwt auth token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenV2Dto" } } } } }, "summary": "Login using email/password", "tags": [ "Login" ] } }, "/v2/workflows/{workflowId}/traces/search": { "post": { "description": "Retrieves the trace ids of a given workflow id and state data", "operationId": "WorkflowV2Controller_searchTraces", "parameters": [ { "name": "workflowId", "required": true, "in": "path", "description": "The name of the workflow", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TraceStateDataDto" } } } }, "responses": { "200": { "description": "The trace ids of the given workflow id and state data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkflowSearchV2Dto" } } } } }, "security": [ { "bearer": [] } ], "summary": "Search traces", "tags": [ "Workflow" ] } }, "/v2/organizations/{name}/workflows": { "get": { "description": "Retrieves the workflows of a given organization by organization name", "operationId": "OrganizationV2Controller_getWorkflowsByOrgName", "parameters": [ { "name": "name", "required": true, "in": "path", "description": "The organization name", "schema": { "type": "string" } } ], "responses": { "200": { "description": "The workflows of the given organization", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkflowIdNameArrayDto" } } } } }, "security": [ { "bearer": [] } ], "summary": "List organization workflows", "tags": [ "Organization" ] } } }, "info": { "title": "Stratumn API", "description": "Interact with Stratumn using simple REST endpoints", "version": "2.0.0", "contact": {} }, "tags": [], "servers": [ { "url": "http://api.local.stratumn.com:3000", "description": "Local development server" }, { "url": "https://api.stratumn.com", "description": "Stratumn Production Server" }, { "url": "https://api.us.stratumn.com", "description": "Stratumn US Production Server" }, { "url": "https://api.preprod.stratumn.com", "description": "Stratumn Preprod Server" }, { "url": "https://api.preprod.us.stratumn.com", "description": "Stratumn US Preprod Server" } ], "components": { "securitySchemes": { "bearer": { "scheme": "bearer", "bearerFormat": "JWT", "type": "http" } }, "schemas": { "TraceStateDto": { "type": "object", "properties": { "state": { "description": "The state data of the trace", "type": "object", "properties": {} } }, "required": [ "state" ] }, "TraceDetailsInputDto": { "type": "object", "properties": { "input": { "description": "The input used to retrieve the links of a given trace" } }, "required": [ "input" ] }, "TraceDetailsDto": { "type": "object", "properties": { "links": { "description": "The links of the trace", "type": "array", "items": { "type": "object", "properties": {} } }, "totalCount": { "description": "The total count of the links", "type": "integer" }, "info": { "type": "object", "properties": { "hasNext": { "type": "boolean" }, "hasPrevious": { "type": "boolean" }, "startCursor": { "type": "string" }, "endCursor": { "type": "string" } }, "required": [ "hasNext", "hasPrevious" ] } }, "required": [ "links", "totalCount", "info" ] }, "TraceStateDataDto": { "type": "object", "properties": { "filters": { "description": "The state data keys and values on which the Traces will be filtered on", "type": "object", "additionalProperties": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" } ] } } } }, "CreateTraceV2Dto": { "type": "object", "properties": { "error": { "description": "The error of the request" }, "data": { "description": "The trace id", "type": "string", "format": "uuid" } }, "required": [ "error" ] }, "GetTraceStateV2Dto": { "type": "object", "properties": { "error": { "description": "The error of the request" }, "data": { "description": "The data of the request", "type": "object", "properties": { "state": { "description": "The state data of the trace", "type": "object", "properties": {} } }, "required": [ "state" ] } }, "required": [ "error" ] }, "TraceDetailsInputV2Dto": { "type": "object", "properties": { "error": { "description": "The error of the request" }, "data": { "description": "The data of the request", "type": "object", "properties": { "last": { "description": "The last number of links to retrieve", "type": "number" }, "before": { "description": "The cursor before which to retrieve links", "type": "string" }, "after": { "description": "The cursor after which to retrieve links", "type": "string" }, "first": { "description": "The first number of links to retrieve", "type": "number" } } } }, "required": [ "error" ] }, "GetTraceDetailsV2Dto": { "type": "object", "properties": { "error": { "description": "The error of the request" }, "data": { "description": "The data of the request", "type": "object", "properties": { "links": { "description": "The links of the trace", "type": "array", "items": { "type": "object", "properties": {} } }, "totalCount": { "description": "The total count of the links", "type": "integer" }, "info": { "type": "object", "properties": { "hasNext": { "type": "boolean" }, "hasPrevious": { "type": "boolean" }, "startCursor": { "type": "string" }, "endCursor": { "type": "string" } }, "required": [ "hasNext", "hasPrevious" ] } }, "required": [ "links", "totalCount", "info" ] } }, "required": [ "error" ] }, "LoginPrivateKeyDto": { "type": "object", "properties": { "privateKey": { "description": "The private key used to login", "type": "string" } }, "required": [ "privateKey" ] }, "TokenDto": { "type": "object", "properties": { "token": { "description": "The token needed (in authorization header) to authenticate requests", "type": "string" } }, "required": [ "token" ] }, "LoginCredentialDto": { "type": "object", "properties": { "email": { "description": "The email used to login", "type": "string" }, "password": { "description": "The password used to login", "type": "string" } }, "required": [ "email", "password" ] }, "TokenV2Dto": { "type": "object", "properties": { "error": { "description": "The error of the request" }, "data": { "description": "The data of the request", "type": "object", "properties": { "token": { "description": "The token needed (in authorization header) to authenticate requests", "type": "string" } }, "required": [ "token" ] } }, "required": [ "error" ] }, "WorkflowIdNameArrayDto": { "type": "array", "items": { "type": "object", "properties": { "workflowId": { "description": "The Workflow ID", "type": "string" }, "workflowName": { "description": "The Workflow Name", "type": "string" } }, "required": [ "workflowId", "workflowName" ] } }, "WorkflowSearchV2Dto": { "type": "object", "properties": { "error": { "description": "The error of the request" }, "data": { "description": "The trace ids", "type": "array", "items": { "type": "string", "format": "uuid" } } }, "required": [ "error" ] } } } }