NAV Navbar
curl

Introduction

Welcome to the Integration Platform REST API documentation v2. It adheres to the JSON API specifications:

Authentication

We use a standard HTTP Basic Authentication mechanism to authenticate each API call with the Integration Platform.

Example Request:

curl https://api.connect.squiz.cloud/v2/users/me \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "id": "USER_ID",
        "type": "user",
        "links": {
            "self": "/v2/users/USER_ID"
        },
        "attributes": {
            "first_name": "FIRST_NAME",
            "last_name": "LAST_NAME",
            "email": "EMAIL",
            "company": "COMPANY_NAME",
            "registered": "REGISTRATION_DATE",
            "last_login": "LAST_LOGIN_DATE"
        }
    },
    "meta": {}
}

HTTP Request

Make an HTTP GET request to /v2/users/me endpoint.

Query Parameters

No query parameters necessary for this call.

Returns

Provides your user information.

Errors

The Integration Platform API uses conventional HTTP response codes to inform the requester about the success or failure of an API calls. Generally: Codes in the 2xx range mean success. Codes in the 4xx range mean an error that failed given the information provided. Codes in the 5xx range mean an error with the Integration Platform platform:

Status Code Meaning
200 - OK Everything worked as expected
201 - Created Requested resource created
204 - No Content Request succeeded, nothing more to give
400 - Bad Request The server cannot or will not process the request due to client error. Often missing required parameter.
401 - Unauthorized No valid API key provided.
403 - Forbidden The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource
404 - Not Found The specified resource could not be found
405 - Method Not Allowed You tried to access a resource with an invalid method
406 - Not Acceptable Your used request in non JSON format
409 - Conflict The resource object’s type is not among the type(s) that constitute the collection represented by the endpoint or a POST request to create a resource with a client-generated ID that already exists
410 - Gone The resource requested has been removed from our servers
413 Payload too large
418 I’m a teapot
429 - Too Many Requests Too many requests hit the API too quickly. Please slow down.
500 - Internal Server Error We have a problem with our server. Try again later
503 - Service Unavailable We’re temporarily offline for maintenance. Please try again later

Auth Clients

To use an OAuth2 based Component in the platform it is required to register a client at the authorization server. Upon registration the authorization server issues the registered client an identifier (client ID) and a secret. These client credentials are used to create a client using the following API. Auth clients can be created on any level: tenant, contract or workspace which incapsulate each other (in order), i.e client created on tenant level is available to use for creating secrets in any workspace of the tenant.

Retrieve All Auth Clients

Example Request:

curl https://api.connect.squiz.cloud/v2/auth-clients \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
    {
      "id": "{AUTH-CLIENT_ID}",
      "type": "auth-client",
      "attributes": {
        "type": "oauth2",
        "name": "Auth client",
        "credentials": {
          "client_id": "{CLIENT_ID}",
          "client_secret": "{CLIENT_SECRET}",
          "refresh_token_uri": "http://example.com",
          "token_expires_in": 18000,
          "token_uri": "{TOKEN_URI}",
          "auth_uri": "{AUTH_URI}"
        }
      },
      "relationships": {
        "components": {
          "data": [
            {
              "id": "{COMPONENT_ID}",
              "type": "component"
            }
          ]
        },
        "workspace": {
          "data": {
            "id": "{WORKSPACE_ID}",
            "type": "workspace"
          },
          "links": {
            "self": "/v2/workspace/{WORKSPACE_ID}"
          }
        }
      },
      "links": {
        "self": "/v2/auth-clients/{AUTH-CLIENT_ID}"
      }
    }
  ],
  "meta": {}
}

This resource allows you to retrieve Auth-clients.

HTTP Request

GET https://api.connect.squiz.cloud/v2/auth-clients

Authorization

This request is authorized with one of the global.auth_clients.get, tenants.auth_clients.get, contracts.auth_clients.get or workspaces.auth_clients.get. Each permission allows to list Auth Clients in particular scope inclusively: global.auth_clients.get allows to list global clients, tenants.auth_clients.get allows to list global and tenant’s clients, contracts.auth_clients.get allows to list global, tenant’s and all tenant’s contracts clients, workspaces.auth_clients.get allows to list all global, tenant’s, contracts’ and workspaces’ clients.

auth_clients.get permissions are also used to authorize access to Auth Client’s credentials field: one can see Auth Client’s credential only if client’s scope and permission’s scope match, i.e. credentials of tenant’s Auth Client are visible for users only with tenants.auth_clients.get permissions, though tenant Auth Client itself is visible for users with workspaces.auth_clients.get.

Query Parameters

Parameter Required Description
filter[component] no Filter the Auth Clients only for specific component. Must be id of Component
workspace_id no* Show Auth Clients available in the given workpspace (including contract’s, tenant’s and global auth-clients).
contract_id no* Show Auth Clients available in the given contract (including tenant’s and global auth-clients).
tenant_id no* Show Auth Clients available in the given tenant and global scope.

* - only one of workspace_id, contract_id, tenant_id can be specified at time. If none these of parameters is specified only global clients will be returned.

Returns

Returns list of the Auth-clients.

Create Auth Client

Example Request:

curl https://api.connect.squiz.cloud/v2/auth-clients \
   -X POST \
   -u {EMAIL}:{APIKEY} \
   -H 'Content-Type: application/json' -d '
    {
   "data":{
      "type":"auth-client",
      "attributes":{
         "type":"oauth2",
         "name":"Auth client",
         "credentials":{
            "client_id":"{CLIENT_ID}",
            "client_secret":"{CLIENT_SECRET}",
            "refresh_token_uri":"http://example.com",
            "token_expires_in":18000,
            "token_uri":"{TOKEN_URI}",
            "auth_uri":"{AUTH_URI}"
         }
      },
      "relationships":{
         "components":{
            "data":[
               {
                  "id":"{COMPONENT_ID}",
                  "type":"component"
               }
            ]
         },
         "workspace":{
            "data":{
               "id":"{WORKSPACE_ID}",
               "type":"workspace"
            }
         }
      }
   }
}'

Example Response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "data": {
    "id": "{AUTH-CLIENT_ID}",
    "type": "auth-client",
    "attributes": {
      "type": "oauth2",
      "name": "Auth client",
      "credentials": {
        "client_id": "{CLIENT_ID}",
        "client_secret": "{CLIENT_SECRET}",
        "refresh_token_uri": "http://example.com",
        "token_expires_in": 18000,
        "token_uri": "{TOKEN_URI}",
        "auth_uri": "{AUTH_URI}"
      }
    },
    "relationships": {
      "components": {
        "data": [
          {
            "id": "{COMPONENT_ID}",
            "type": "component"
          }
        ]
      },
      "workspace": {
        "data": {
          "id": "{WORKSPACE_ID}",
          "type": "workspace"
        },
        "links": {
          "self": "/v2/workspaces/{WORKSPACE_ID}"
        }
      }
    },
    "links": {
      "self": "/v2/auth-clients/{AUTH-CLIENT_ID}"
    }
  },
  "meta": {}
}

This resource allows you to create an Auth-client. Scope where client is created is controlled by corresponding relationship: workspace, contract or tenant. No relationship means that auth-client will be created in the global scope.

HTTP Request

POST https://api.connect.squiz.cloud/v2/auth-clients

Authorization

This request is authorized for the global scope with the global.auth_clients.create permission, for the tenant’s scope members with the tenants.auth_clients.create permission, for the contract’s scope members with the contracts.auth_clients.create, for the workspace’s scope members with the workspaces.auth_clients.create.

Body Parameters

Parameter Required Description
type yes Allowed value: auth-client
attributes.name yes Auth Client name
attributes.type yes Auth Client type. May be any of: oauth2and other types (noauth, basic,api_key)
attributes.credentials yes Auth Client credentials (can be an empty object if Auth Client type is not oauth2)
attributes.credentials.client_id yes (if attributes.type is oauth2) Auth Client client ID
attributes.credentials.client_secret yes (if attributes.type is oauth2) Auth Client client secret
attributes.credentials.refresh_token_uri yes (if attributes.type is oauth2) Auth Client refresh token URI
attributes.credentials.token_expires_in no (default: 3600) The value that will be set as expires_in in Auth Secret linked to the Auth Client after Auth Secret refresh if Auth Secret does not contain it.
attributes.credentials.token_uri yes (if attributes.type is oauth2) Auth Client token URI
attributes.credentials.auth_uri yes (if attributes.type is oauth2) Auth Client auth URI
relationships.components.data[].component.type yes Allowed value: component
relationships.components.data[].component.id yes Component ID
relationships.tenant.data.type no Allowed value: tenant
relationships.tenant.data.id no Tenant ID
relationships.contract.data.type no Allowed value: contract
relationships.contract.data.id no Contract ID
relationships.workspace.data.type no Allowed value: workspace
relationships.workspace.data.id no Workspace ID

Returns

Returns the created Auth Client object.

Retrieve the Auth Client by ID

Example Request:

curl https://api.connect.squiz.cloud/v2/auth-clients/{AUTH-CLIENT_ID}?workspace_id={WORKSPACE_ID} \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json


{
  "data": {
    "id": "{AUTH-CLIENT_ID}",
    "type": "auth-client",
    "attributes": {
      "type": "oauth2",
      "name": "Auth client",
      "credentials": {
        "client_id": "{CLIENT_ID}",
        "client_secret": "{CLIENT_SECRET}",
        "refresh_token_uri": "http://example.com",
        "token_expires_in": 18000,
        "token_uri": "{TOKEN_URI}",
        "auth_uri": "{AUTH_URI}"
      }
    },
    "relationships": {
      "components": {
        "data": [
          {
            "id": "{COMPONENT_ID}",
            "type": "component"
          }
        ]
      },
      "workspace": {
        "data": {
          "id": "{WORKSPACE_ID}",
          "type": "workspace"
        },
        "links": {
          "self": "/v2/workspaces/{WORKSPACE_ID}"
        }
      }
    },
    "links": {
      "self": "/v2/auth-clients/{AUTH-CLIENT_ID}"
    }
  },
  "meta": {}
}

This resource allows you to retrieve an Auth Client by its ID.

HTTP Request

GET https://api.connect.squiz.cloud/v2/auth-clients/{AUTH-CLIENT_ID}

Authorization

This request is authorized with one of the global.auth_clients.get, tenants.auth_clients.get, contracts.auth_clients.get or workspaces.auth_clients.get. Each permission allows to get Auth Client in particular scope inclusively: global.auth_clients.get allows to get global client, tenants.auth_clients.get allows to get global and tenant’s client, contracts.auth_clients.get allows to get global, tenant’s and all tenant’s contracts clients, workspaces.auth_clients.get allows to get global, tenant’s, contracts’ and workspaces’ clients.

auth_clients.get permissions are also used to authorize access to Auth Client’s credentials field: one can see Auth Client’s credential only if client’s scope and permission’s scope match, i.e. credentials of tenant’s Auth Client are visible for users only with tenants.auth_clients.get permissions, though tenant Auth Client itself is visible for users with workspaces.auth_clients.get.

To specify scope of request one of workspace_id, contract_id or tenant_id query parameters is used. For example, tenant auth client can be retrieved by id if user has workspaces.auth_clients.get permission in one of the tenant’s workspaces, so to specify those workspace workspace_id query parameter is used, without scope parameter you can get only global client. In case if the user tries to get not a global client and doesn’t specify the query parameter - such request will be rejected, as permission can’t be checked.

URL Parameters

Parameter Required Description
AUTH-CLIENT_ID yes Auth Client ID

Query Parameters

Parameter Required Description
workspace_id no Show auth-client available in the given workspace (including global, tenant’s and contract’s auth-clients).
contract_id no Show auth-client available in the given contract (including global and tenant’s auth-clients).
tenant_id no Show auth-client available in the given tenant and global scopes.

Returns

The Auth Client with given ID

Update the Auth Client

Example Request:

curl https://api.connect.squiz.cloud/v2/auth-clients/{AUTH-CLIENT_ID} \
   -X PATCH \
   -u {EMAIL}:{APIKEY} \
   -H 'Content-Type: application/json' -d '
   {
    "data":{
      "id":"{AUTH-CLIENT_ID}",
      "type":"auth-client",
      "attributes":{
        "name":"Auth client",
        "credentials":{
          "client_secret": "{CLIENT_SECRET}",
          "token_expires_in": 18000
        }
      },
      "relationships":{
        "components":{
          "data":[
            {
              "id":"{COMPONENT_ID}",
              "type":"component"
            }
          ]
        }
      }
    }
  }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
   "data":{
      "id":"{AUTH-CLIENT_ID}",
      "type":"auth-client",
      "attributes":{
         "type":"oauth2",
         "name":"Auth client",
         "credentials":{
           "client_id": "{CLIENT_ID}",
           "client_secret": "{CLIENT_SECRET}",
           "refresh_token_uri": "http://example.com",
           "token_expires_in": 18000,
           "token_uri": "{TOKEN_URI}",
           "auth_uri": "{AUTH_URI}"
         }
      },
      "relationships":{
        "components": {
          "data": [
            {
              "id": "{COMPONENT_ID}",
              "type": "component"
            }
          ]
        },
         "tenant":{
            "data":{
               "id":"{TENANT_ID}",
               "type":"tenant"
            },
            "links":{
               "self":"/v2/tenants/{TENANT_ID}"
            }
         }
      },
     "links":{
       "self":"/v2/auth-clients/{AUTH-CLIENT_ID}"
     }
   },
   "meta":{}
}

This resource allows you to update the Auth Client. If the Auth Client with type oauth2 then you can update name, token_expires_in and linked components, otherwise if the type is other, then you can put in credentials any data that you want and add components which can use this Auth Client.

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/auth-clients/{AUTH-CLIENT_ID}

Authorization

This request is authorized for members with appropriate permission.

URL Parameters

Parameter Required Description
AUTH-CLIENT_ID yes Auth Client ID

Body Parameters

Parameter Required Description
type yes Allowed value: auth-client
attributes.name no New name of the Auth Client
attributes.credentials.client_secret no Auth Client client secret
attributes.credentials.token_expires_in no The value that will be set as expires_in in Auth Secret linked to the Auth Client after Auth Secret refresh if Auth Secret does not contain it.
relationships.components.data[].component.type no Allowed value: component
relationships.components.data[].component.id no Component ID

Returns

Returns the updated Auth Client object.

Delete Auth Client

Example Request:

curl https://api.connect.squiz.cloud/v2/auth-clients/{AUTH-CLIENT_ID} \
   -X DELETE \
   -u {EMAIL}:{APIKEY}

This resource allows you to delete an Auth Client. You can’t delete an Auth Client, while it has one or more secrets attached.

HTTP Request

DELETE {{ api_base_url }/v2/auth-clients/{AUTH-CLIENT_ID}

Authorization

This request is authorized for members with appropriate permission.

URL Parameters

Parameter Required Description
AUTH-CLIENT_ID yes Auth Client ID

Example Response:

HTTP/1.1 204 No Content

Auth Secrets

The Secret is used to expose the information that the platform needs to collect from the integrator to be able to connect to their instance/account. The information collected typically includes:

Check Create a flow section on how to use a secret in your flow.

Retrieve All Auth Secrets

Example Request:

curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/secrets \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
   "data":[
      {
         "id":"{AUTH-SECRET_ID}",
         "type":"auth-secret",
         "attributes":{
            "name":"Auth secret",
            "state":"ready",
            "credentials":{
              "access_token": "{ACCESS_TOKEN}",
              "refresh_token": "{REFRESH_TOKEN}",
              "expires_in": "{EXPIRES_IN}"
            }
         },
         "relationships":{
            "workspace":{
               "data":{
                  "id":"{WORKSPACE_ID}",
                  "type":"workspace"
               },
               "links":{
                  "self":"/v2/workspace/{WORKSPACE_ID}"
               }
            },
            "user":{
               "data":{
                  "id":"{USER_ID}",
                  "type":"user"
               },
               "links":{
                  "self":"/v2/users/{USER_ID}"
               }
            },
            "auth-client":{
               "data":{
                  "id":"{AUTH-CLIENT_ID}",
                  "type":"auth-client"
               },
               "links":{
                  "self":"/v2/tenantns/{TENANT_ID}/auth-clients/{AUTH-CLIENT_ID}"
               }
            }
         },
        "links":{
          "self":"/v2/workspace/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID}"
        }
      }
   ],
   "meta":{}
}

This resource allows you to retrieve all the Auth Secrets belonging to the given Workspace.

HTTP Request

GET https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/secrets

Authorization

This request is authorized for the Workspace’s scope members with the workspaces.auth_secret.get permission.

URL Parameters

Parameter Required Description
WORKSPACE_ID yes Workspace ID

Query Parameters

Parameter Required Description
filter[user] no Filter the Auth Secrets only for specific User. Must be id of User
filter[auth_client] no Filter the Auth Secrets only for specific Auth-client. Must be id of Auth-client

Returns

Returns all the Auth Secrets belonging to the given Workspace.

Create Auth Secret

Example Request:

curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/secrets \
   -X POST \
   -u {EMAIL}:{APIKEY} \
   -H 'Content-Type: application/json' -d '
    {
     "data":{
       "type":"auth-secret",
       "attributes":{
          "name":"Auth secret",
          "state":"ready",
          "credentials":{
            "access_token": "{ACCESS_TOKEN}",
            "refresh_token": "{REFRESH_TOKEN}",
            "expires_in": "{EXPIRES_IN}",
            "additional_params": "{ADDITIONAL_PARAMS}"
          }
       },
       "relationships":{
          "auth_client":{
             "data":{
                "id":"{AUTH-CLIENT_ID}",
                "type":"auth-client"
             }
          }
       }
   }'

Example Response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "data":{
     "id":"{AUTH-SECRET_ID}",
     "type":"auth-secret",
     "attributes":{
        "name":"Auth secret",
        "state":"ready",
        "credentials":{
          "access_token": "{ACCESS_TOKEN}",
          "refresh_token": "{REFRESH_TOKEN}",
          "expires_in": "{EXPIRES_IN}",
          "additional_params": "{ADDITIONAL_PARAMS}"
        }
     },
     "relationships":{
        "workspace":{
           "data":{
              "id":"{WORKSPACE_ID}",
              "type":"workspace"
           },
           "links":{
              "self":"/v2/workspace/{WORKSPACE_ID}"
           }
        },
        "user":{
           "data":{
              "id":"{USER_ID}",
              "type":"user"
           },
           "links":{
              "self":"/v2/users/{USER_ID}"
           }
        },
        "auth-client":{
           "data":{
              "id":"{AUTH-CLIENT_ID}",
              "type":"auth-client"
           },
           "links":{
              "self":"/v2/tenantns/{TENANT_ID}/auth-clients/{AUTH-CLIENT_ID}"
           }
        }
     },
    "links":{
      "self":"/v2/workspace/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID}"
    }
  },
   "meta":{}
}

This resource allows you to create an Auth Secret. If related Auth Client has type oauth2 then credentials object must contain only properties access_token, refresh_token, otherwise if the type is other, then you can put in credentials any data that you want.

HTTP Request

POST https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/secrets

Authorization

This request is authorized for the Workspace’s scope members with the workspaces.auth_secret.create permission.

URL Parameters

Parameter Required Description
WORKSPACE_ID yes Workspace ID

Body Parameters

Parameter Required Description
type yes Allowed value: auth-secret
attributes.name yes Auth Secret name
attributes.state yes Auth Secret type. May be any of: ready, error
attributes.error no Auth Secret error
attributes.credentials yes Auth Secret credentials
attributes.credentials.access_token yes (if auth-client is oauth2) Auth Secret access token
attributes.credentials.refresh_token no Auth Secret refresh token
attributes.credentials.expires_in no Auth Secret expires in. If not specified and auth-client is oauth2 then the value will be taken from token_expires_in of linked auth-client
attributes.credentials.additional_params no (if auth-client is oauth2) Auth Secret additional parameters
relationships.auth_client.data.type yes Allowed value: auth-client
relationships.auth_client.data.id yes Auth Client ID

Returns

Returns the created Auth Secret object.

Refresh the Auth Secret

Example Request:

curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID}/refresh \
   -X POST \
   -u {EMAIL}:{APIKEY} \
   -H 'Content-Type: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
    {
      "id": "{AUTH-SECRET_ID}",
      "type": "auth-secret",
      "attributes": {
        "name": "Auth secret",
        "state": "ready",
        "credentials": {
          "access_token": "{ACCESS_TOKEN}",
          "refresh_token": "{REFRESH_TOKEN}",
          "expires_in": "{EXPIRES_IN}"
        }
      },
      "relationships": {
        "workspace": {
          "data": {
            "id": "{WORKSPACE_ID}",
            "type": "workspace"
          },
          "links": {
            "self": "/v2/workspace/{WORKSPACE_ID}"
          }
        },
        "user": {
          "data": {
            "id": "{USER_ID}",
            "type": "user"
          },
          "links": {
            "self": "/v2/users/{USER_ID}"
          }
        },
        "auth-client": {
          "data": {
            "id": "{AUTH-CLIENT_ID}",
            "type": "auth-client"
          },
          "links": {
            "self": "/v2/tenantns/{TENANT_ID}/auth-clients/{AUTH-CLIENT_ID}"
          }
        }
      },
      "links": {
        "self": "/v2/workspace/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID}"
      }
    }
  ],
  "meta": {}
}

This resource allows you to manually refresh the Auth Secret if it supports this operation.

HTTP Request

POST https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID}/refresh

Authorization

This request is authorized for the Workspace’s scope members with the workspaces.auth_secret.refresh permission.

URL Parameters

Parameter Required Description
WORKSPACE_ID yes Workspace ID
AUTH-SECRET_ID yes Auth Secret ID

Returns

Returns the Auth Secret object.

Retrieve Auth Secret by ID

Example Request:

curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID} \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "{AUTH-SECRET_ID}",
    "type": "auth-secret",
    "attributes": {
      "name": "Auth secret",
      "state": "error",
      "error": "Something went technical wrong",
      "credentials": {
        "access_token": "{ACCESS_TOKEN}",
        "refresh_token": "{REFRESH_TOKEN}",
        "expires_in": "{EXPIRES_IN}"
      }
    },
    "relationships": {
      "workspace": {
        "data": {
          "id": "{WORKSPACE_ID}",
          "type": "workspace"
        },
        "links": {
          "self": "/v2/workspace/{WORKSPACE_ID}"
        }
      },
      "user": {
        "data": {
          "id": "{USER_ID}",
          "type": "user"
        },
        "links": {
          "self": "/v2/users/{USER_ID}"
        }
      },
      "auth-client": {
        "data": {
          "id": "{AUTH-CLIENT_ID}",
          "type": "auth-client"
        },
        "links": {
          "self": "/v2/tenantns/{TENANT_ID}/auth-clients/{AUTH-CLIENT_ID}"
        }
      }
    },
    "links": {
      "self": "/v2/workspace/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID}"
    }
  },
  "meta": {}
}

This resource allows you to retrieve the Auth-secret by its identifier. If the Auth-secret with given ID does not belong to the current Workspace, an error will be returned.

HTTP Request

GET https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID}

Authorization

This request is authorized for the workspace’s scope members with the workspaces.auth_secret.get permission.

URL Parameters

Parameter Required Description
WORKSPACE_ID yes Workspace ID
AUTH-SECRET_ID yes Auth Secret ID

Returns

Auth Secret with the given ID

Update the Auth Secret

Example Request:

curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID} \
   -X PATCH \
   -u {EMAIL}:{APIKEY} \
   -H 'Content-Type: application/json' -d '
    {
      "data": {
        "id": "{AUTH-SECRET_ID}",
        "type": "auth-secret",
        "attributes": {
          "name": "Auth secret",
          "state": "error",
          "error": "Something went technical wrong",
          "credentials": {
            "access_token": "{ACCESS_TOKEN}",
            "refresh_token": "{REFRESH_TOKEN}",
            "expires_in": "{EXPIRES_IN}"
          }
        }
      }
    }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "{AUTH-SECRET_ID}",
    "type": "auth-secret",
    "attributes": {
      "name": "Auth secret",
      "state": "error",
      "error": "Something went technical wrong",
      "credentials": {
        "access_token": "{ACCESS_TOKEN}",
        "refresh_token": "{REFRESH_TOKEN}",
        "expires_in": "{EXPIRES_IN}"
      }
    },
    "relationships": {
      "workspace": {
        "data": {
          "id": "{WORKSPACE_ID}",
          "type": "workspace"
        },
        "links": {
          "self": "/v2/workspace/{WORKSPACE_ID}"
        }
      },
      "user": {
        "data": {
          "id": "{USER_ID}",
          "type": "user"
        },
        "links": {
          "self": "/v2/users/{USER_ID}"
        }
      },
      "auth-client": {
        "data": {
          "id": "{AUTH-CLIENT_ID}",
          "type": "auth-client"
        },
        "links": {
          "self": "/v2/tenantns/{TENANT_ID}/auth-clients/{AUTH-CLIENT_ID}"
        }
      }
    },
    "links": {
      "self": "/v2/workspace/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID}"
    }
  },
  "meta": {}
}

This resource allows you to update the Auth Secret. If related Auth-client has type oauth2 then credentials object must contain only properties access_token, refresh_token, otherwise if the type is other, then you can put in credentials any data that you want.

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/tenants/{TENANT_ID}/auth-clients/{AUTH-CLIENT_ID}

Authorization

This request is authorized for the Workspace’s scope members with the workspaces.auth_secret.edit permission.

URL Parameters

Parameter Required Description
WORKSPACE_ID yes Workspace ID
AUTH-SECRET_ID yes Auth Secret ID

Body Parameters

Parameter Required Description
type yes Allowed value: auth-secret
attributes.name no New name of the Auth Secret
attributes.credentials no Auth Secret credentials

Returns

Returns the updated Auth-secret object.

Delete Auth Secret

Example Request:

curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID} \
   -X DELETE \
   -u {EMAIL}:{APIKEY}

This resource allows you to delete the Auth Secret.

HTTP Request

DELETE {{ api_base_url }/v2/workspaces/{WORKSPACE_ID}/secrets/{AUTH-SECRET_ID}

Authorization

This request is authorized for the Workspace’s scope members with the workspaces.auth_secret.delete permission.

URL Parameters

Parameter Required Description
WORKSPACE_ID yes Workspace ID
AUTH-SECRET_ID yes Auth Secret ID

Example Response:

HTTP/1.1 204 No Content

Components

Accessing and sharing components

Each Component belongs to a Team. Each User who is a member of the team can edit the component.

The component has an attribute access, which indicates how is the component shared by the other clients. “Shared” means, that the component can be used by the users in their flows. There are three sharing modes:

Accordingly, a set of components, available for each user is consist of: not shared components from the user’s Contract, components with tenant access and global components.

Retrieve all available components

Example Request:

curl https://api.connect.squiz.cloud/v2/components?contract_id={CONTRACT_ID} \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":[
    {
      "id":"{COMPONENT_ID}",
      "type":"component",
      "links":{
        "self":"/v2/components/{COMPONENT_ID}"
      },
      "attributes":{
        "name":"name",
        "team_name":"team_name",
        "access": "tenant"
      },
      "relationships":{
        "versions":{
          "links":{
            "related":"/v2/components/{COMPONENT_ID}/versions"
          }
        },
        "latest_version":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"version"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}/versions/latest"
          }
        }
      }
    }
  ],
  "meta":{},
  "included":[
    {
      "id":"{GIT_REVISION}",
      "type":"version",
      "links":{
        "self":"/v2/versions/{GIT_REVISION}"
      },
      "attributes":{
        "date":1517392057184,
        "version_number":69
      },
      "relationships":{
        "descriptor":{
          "data":{
            "id":"0eff1d1a46b78ba1f468982e16d0382e8a91280d",
            "type":"descriptor"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/descriptor"
          }
        },
        "component":{
          "data":{
            "id":"{COMPONENT_ID}",
            "type":"component"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}"
          }
        }
      }
    },
    {
      "id":"0eff1d1a46b78ba1f468982e16d0382e8a91280d",
      "type":"descriptor",
      "links":{
        "self":"/v2/descriptors/0eff1d1a46b78ba1f468982e16d0382e8a91280d"
      },
      "attributes":{
        "repo_name":"repo_name",
        "team_name":"team_name",
        "short_revision":"0eff1d1",
        "is_latest":true,
        "description":"desc",
        "icon":"BASE64",
        "language":"nodejs",
        "sailor_version":"2.1.6",
        "title":"Data mapper",
        "service":"mapper",
        "actions":{
          "map":{
            "title":"Mapper",
            "main":"./map.js"
          },
          "jsonataMap":{
            "title":"Jsonata mapper",
            "main":"./jsonata_map.js"
          }
        },
        "fields":{
          "mapper":{
            "viewClass":"MapperView"
          }
        }
      },
      "relationships":{
        "version":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"version"
          },
          "links":{
            "self":"/v2/{COMPONENT_ID}/versions/{GIT_REVISION}"
          }
        }
      }
    }
  ],
  "links":{
    "self":"/v2/components"
  }
}

This endpoint retrieves a list of available components. Response includes latest descriptor for each component. More details about the component descriptors can be found here.

HTTP Request

GET https://api.connect.squiz.cloud/v2/components?contract_id={CONTRACT_ID}

HTTP Request with parameters

GET https://api.connect.squiz.cloud/v2/components?contract_id={CONTRACT_ID}&filter[access]=private

Query Parameters

Parameter Required Description
contract_id yes An Id of the Contract
filter[access] No Allowed values: private (only components from own Contract returned), public (only shared components from the other Contracts) and all (default value, returns all available components).

Returns

Returns repositories metadata object if the call succeeded.

Retrieve all available components in workspace with respect of whitelist

Example Request:

curl https://api.connect.squiz.cloud/v2/workspace/{WORKSPACE_ID}/components \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":[
    {
      "id":"{COMPONENT_ID}",
      "type":"component",
      "links":{
        "self":"/v2/components/{COMPONENT_ID}"
      },
      "attributes":{
        "name":"name",
        "team_name":"team_name",
        "access": "tenant",
        "whitelisted_contract_ids": [
          "{CONTRACT_ID}"
        ]
      },
      "relationships":{
        "versions":{
          "links":{
            "related":"/v2/components/{COMPONENT_ID}/versions"
          }
        },
        "latest_version":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"version"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}/versions/latest"
          }
        }
      }
    }
  ],
  "meta":{},
  "included":[
    {
      "id":"{GIT_REVISION}",
      "type":"version",
      "links":{
        "self":"/v2/versions/{GIT_REVISION}"
      },
      "attributes":{
        "date":1517392057184,
        "version_number":69
      },
      "relationships":{
        "descriptor":{
          "data":{
            "id":"0eff1d1a46b78ba1f468982e16d0382e8a91280d",
            "type":"descriptor"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/descriptor"
          }
        },
        "component":{
          "data":{
            "id":"{COMPONENT_ID}",
            "type":"component"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}"
          }
        }
      }
    },
    {
      "id":"0eff1d1a46b78ba1f468982e16d0382e8a91280d",
      "type":"descriptor",
      "links":{
        "self":"/v2/descriptors/0eff1d1a46b78ba1f468982e16d0382e8a91280d"
      },
      "attributes":{
        "repo_name":"repo_name",
        "team_name":"team_name",
        "short_revision":"0eff1d1",
        "is_latest":true,
        "description":"desc",
        "icon":"BASE64",
        "language":"nodejs",
        "sailor_version":"2.1.6",
        "title":"Data mapper",
        "service":"mapper",
        "actions":{
          "map":{
            "title":"Mapper",
            "main":"./map.js"
          },
          "jsonataMap":{
            "title":"Jsonata mapper",
            "main":"./jsonata_map.js"
          }
        },
        "fields":{
          "mapper":{
            "viewClass":"MapperView"
          }
        }
      },
      "relationships":{
        "version":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"version"
          },
          "links":{
            "self":"/v2/{COMPONENT_ID}/versions/{GIT_REVISION}"
          }
        }
      }
    }
  ]
}

In case tenant feature flag for component whitelist is enabled and workspace has type full - this endpoint retrieves a list of available components in given workspace with respect of component whitelist. Otherwise (i.e. if either feature flag is disabled, or workspace has type limited) - it retrieves a list of all available components in given workspace Response includes latest descriptor for each component. More details about the component descriptors can be found here.

HTTP Request

GET https://api.connect.squiz.cloud/v2/workspace/{WORKSPACE_ID}/components

Authorization

User has to be a member of the Workspace

URL Parameters

Parameter Required Description
WORKSPACE_ID Yes An Id of the Workspace

Returns

Returns repositories metadata object if the call succeeded.

Retrieve all components

Example Request:

curl https://api.connect.squiz.cloud/v2/components/all \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":[
    {
      "id":"{COMPONENT_ID}",
      "type":"component",
      "links":{
        "self":"/v2/components/{COMPONENT_ID}"
      },
      "attributes":{
        "name":"name",
        "team_name":"team_name",
        "access": "tenant"
      },
      "relationships":{
        "versions":{
          "links":{
            "related":"/v2/components/{COMPONENT_ID}/versions"
          }
        },
        "latest_version":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"version"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}/versions/latest"
          }
        }
      }
    }
  ],
  "meta":{},
  "included":[
    {
      "id":"{GIT_REVISION}",
      "type":"version",
      "links":{
        "self":"/v2/versions/{GIT_REVISION}"
      },
      "attributes":{
        "date":1517392057184,
        "version_number":69
      },
      "relationships":{
        "descriptor":{
          "data":{
            "id":"0eff1d1a46b78ba1f468982e16d0382e8a91280d",
            "type":"descriptor"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/descriptor"
          }
        },
        "component":{
          "data":{
            "id":"{COMPONENT_ID}",
            "type":"component"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}"
          }
        }
      }
    },
    {
      "id":"0eff1d1a46b78ba1f468982e16d0382e8a91280d",
      "type":"descriptor",
      "links":{
        "self":"/v2/descriptors/0eff1d1a46b78ba1f468982e16d0382e8a91280d"
      },
      "attributes":{
        "repo_name":"repo_name",
        "team_name":"team_name",
        "short_revision":"0eff1d1",
        "is_latest":true,
        "description":"desc",
        "icon":"BASE64",
        "language":"nodejs",
        "sailor_version":"2.1.6",
        "title":"Data mapper",
        "service":"mapper",
        "actions":{
          "map":{
            "title":"Mapper",
            "main":"./map.js"
          },
          "jsonataMap":{
            "title":"Jsonata mapper",
            "main":"./jsonata_map.js"
          }
        },
        "fields":{
          "mapper":{
            "viewClass":"MapperView"
          }
        }
      },
      "relationships":{
        "version":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"version"
          },
          "links":{
            "self":"/v2/{COMPONENT_ID}/versions/{GIT_REVISION}"
          }
        }
      }
    }
  ],
  "links":{
    "self":"/v2/components"
  }
}

This endpoint retrieves a list of all components. Response includes latest descriptor for each component. More details about the component descriptors can be found here.

HTTP Request

GET https://api.connect.squiz.cloud/v2/components/all

Authorization

This request is authorized only for the User with tenants.component.list_all permission.

Query Parameters

Parameter Required Description
contract_id no An Id of the Contract

Returns

Returns repositories metadata object if the call succeeded.

Retrieve a component by ID

Example Request:

curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID} \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"{COMPONENT_ID}",
    "type":"component",
    "links":{
      "self":"/v2/components/{COMPONENT_ID}"
    },
    "attributes":{
      "name":"component name",
      "team_name":"{team_name}",
      "access": "team"
    },
    "relationships":{
      "versions":{
        "links":{
          "related":"/v2/components/{COMPONENT_ID}/versions"
        }
      },
      "latest_version":{
        "data":{
          "id":"{GIT_REVISION}",
          "type":"version"
        },
        "links":{
          "self":"/v2/components/{COMPONENT_ID}/versions/latest"
        }
      }
    }
  },
  "meta":{},
  "included":[
    {
      "id":"{GIT_REVISION}",
      "type":"version",
      "links":{
        "self":"/v2/versions/{GIT_REVISION}"
      },
      "attributes":{
        "date":1513183339032,
        "version_number":7
      },
      "relationships":{
        "descriptor":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"descriptor"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/descriptor"
          }
        },
        "component":{
          "data":{
            "id":"{COMPONENT_ID}",
            "type":"component"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}"
          }
        }
      }
    },
    {
      "id":"{GIT_REVISION}",
      "type":"descriptor",
      "links":{
        "self":"/v2/descriptors/{GIT_REVISION}"
      },
      "attributes":{
        "repo_name":"repo_name",
        "team_name":"team_name",
        "short_revision":"df7cf1d",
        "is_latest":true,
        "description":"desc",
        "icon":"BASE64",
        "language":"nodejs",
        "sailor_version":"2.2.1",
        "title":"title",
        "actions":{
          "update":"<Actions Object>"
        },
        "triggers":{
          "select":"<Triggers Object>"
        },
        "credentials":{
          "fields":{
            "apiKey":{
              "label":"API key",
              "required":true,
              "viewClass":"TextFieldWithNoteView",
              "note":"{note}"
            }
          }
        }
      },
      "relationships":{
        "version":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"version"
          },
          "links":{
            "self":"/v2/{COMPONENT_ID}/versions/{GIT_REVISION}"
          }
        }
      }
    }
  ]
}

HTTP Request

GET https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}

URL Parameters

Parameter Required Description
COMPONENT_ID Yes Component identifier

Authorization

The component should be accessible to the client (e.g. component from the own Contract or shared one).

Returns

This endpoint returns a component object and includes latest descriptor for each component.

Retrieve a component by ID with respect of whitelist

Example Request:

curl https://api.connect.squiz.cloud/v2/workspace/{WORKSPACE_ID}/components/{COMPONENT_ID} \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"{COMPONENT_ID}",
    "type":"component",
    "links":{
      "self":"/v2/components/{COMPONENT_ID}"
    },
    "attributes":{
      "name":"component name",
      "team_name":"{team_name}",
      "access": "team",
      "whitelisted_contract_ids": [
        "{CONTRACT_ID}"
      ]
    },
    "relationships":{
      "versions":{
        "links":{
          "related":"/v2/components/{COMPONENT_ID}/versions"
        }
      },
      "latest_version":{
        "data":{
          "id":"{GIT_REVISION}",
          "type":"version"
        },
        "links":{
          "self":"/v2/components/{COMPONENT_ID}/versions/latest"
        }
      }
    }
  },
  "meta":{},
  "included":[
    {
      "id":"{GIT_REVISION}",
      "type":"version",
      "links":{
        "self":"/v2/versions/{GIT_REVISION}"
      },
      "attributes":{
        "date":1513183339032,
        "version_number":7
      },
      "relationships":{
        "descriptor":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"descriptor"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/descriptor"
          }
        },
        "component":{
          "data":{
            "id":"{COMPONENT_ID}",
            "type":"component"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}"
          }
        }
      }
    },
    {
      "id":"{GIT_REVISION}",
      "type":"descriptor",
      "links":{
        "self":"/v2/descriptors/{GIT_REVISION}"
      },
      "attributes":{
        "repo_name":"repo_name",
        "team_name":"team_name",
        "short_revision":"df7cf1d",
        "is_latest":true,
        "description":"desc",
        "icon":"BASE64",
        "language":"nodejs",
        "sailor_version":"2.2.1",
        "title":"title",
        "actions":{
          "update":"<Actions Object>"
        },
        "triggers":{
          "select":"<Triggers Object>"
        },
        "credentials":{
          "fields":{
            "apiKey":{
              "label":"API key",
              "required":true,
              "viewClass":"TextFieldWithNoteView",
              "note":"{note}"
            }
          }
        }
      },
      "relationships":{
        "version":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"version"
          },
          "links":{
            "self":"/v2/{COMPONENT_ID}/versions/{GIT_REVISION}"
          }
        }
      }
    }
  ]
}

HTTP Request

GET https://api.connect.squiz.cloud/v2/workspace/{WORKSPACE_ID}/components/{COMPONENT_ID}

URL Parameters

Parameter Required Description
WORKSPACE_ID Yes An Id of the Workspace
COMPONENT_ID Yes Component identifier

Authorization

User has to be a member of the Workspace and the component should be accessible to the client. In case tenant feature flag for component whitelist is enabled and workspace has type full - component has to be either from the own Contract or whitelisted. Otherwise (i.e. if either feature flag is disabled, or workspace has type limited) - it has to be either from the own Contract or public.

Returns

This endpoint returns a component object and includes latest descriptor.

Retrieve component versions

Example Request:

curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":[
    {
      "id":"{GIT_REVISION}",
      "type":"version",
      "links":{
        "self":"/v2/versions/{GIT_REVISION}"
      },
      "attributes":{
        "date":1508754889997,
        "version_number":1
      },
      "relationships":{
        "descriptor":{
          "data":{
            "id":"{GIT_REVISION}",
            "type":"descriptor"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/descriptor"
          }
        },
        "component":{
          "data":{
            "id":"{COMPONENT_ID}",
            "type":"component"
          },
          "links":{
            "self":"/v2/components/{COMPONENT_ID}"
          }
        }
      }
    }
  ],
  "meta":{},
  "links":{
    "self":"/v2/components/{COMPONENT_ID}/versions"
  }
}

This endpoint retrieves list of component’s versions

HTTP Request

GET https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions

URL Parameters

Parameter Required Description
COMPONENT_ID Yes Component identifier

Authorization

The component should be accessible to the client (e.g. component from the own Contract or shared one).

Returns

Returns repositories build metadata object if the call succeeded.

Retrieve a component descriptor

Example Request:

curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/descriptor \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"{GIT_REVISION}",
    "type":"descriptor",
    "links":{
      "self":"/v2/descriptors/{GIT_REVISION}"
    },
    "attributes":{
      "repo_name":"repo_name",
      "team_name":"team_name",
      "short_revision":"cf0a2d9",
      "is_latest":true,
      "description":"desc",
      "icon":"BASE64",
      "language":"nodejs",
      "sailor_version":"2.2.1",
      "title":"title",
      "actions":{
        "update":"<Actions Object>"
      },
      "triggers":{
        "select":"<Triggers Object>"
      },
      "credentials":{
        "fields":{
          "apiKey":{
            "label":"API key",
            "required":true,
            "viewClass":"TextFieldWithNoteView",
            "note":"note"
          }
        }
      }
    },
    "relationships":{
      "version":{
        "data":{
          "id":"{GIT_REVISION}",
          "type":"version"
        },
        "links":{
          "self":"/v2/{COMPONENT_ID}/versions/{GIT_REVISION}"
        }
      }
    }
  },
  "meta":{}
}

This endpoint retrieves an information about single component by it’s ID and/or version, for latest version use latest. More details can be find here.

HTTP Request

GET https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/descriptor

or

GET https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/latest/descriptor

URL Parameters

Parameter Required Description
COMPONENT_ID Yes Component identifier
GIT_REVISION Yes Revision of the component’s build. Use latest to retrieve the descriptor of the most recent successful build.

Authorization

The component should be accessible for the client (e.g. component from own Contract or shared one).

Returns

Returns component descriptor if the call succeeded.

Create a component repository

Example Request:

curl https://api.connect.squiz.cloud/v2/components/ \
   -X POST \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'
   -H 'Content-Type: application/json' -d '
      {
        "data":{
          "type":"component",
          "attributes":{
            "name":"mycomponent"
          },
          "relationships":{
            "team":{
              "data":{
                "type":"team",
                "id":"{TEAM_ID}"
              }
            },
            "contract":{
              "data":{
                "type":"contract",
                "id":"{CONTRACT_ID}"
              }
            }
          }
        }
      }'

Example Response:

HTTP/1.1 201 Created
Content-Type: application/json
{
  "data":{
    "id":"{REPOSITORY_ID}",
    "type":"component",
    "links":{
      "self":"/v2/components/{REPOSITORY_ID}"
    },
    "attributes":{
      "name":"{REPOSITORY_NAME}",
      "team_name":"{TEAM_NAME}",
      "access": "team"
    },
    "relationships":{
      "versions":{
        "links":{
          "related":"/v2/components/{REPOSITORY_ID}/versions"
        }
      }
    }
  },
  "meta":{}
}

This resource allows you to create a component repository. A component repository always belongs to a team. If you don’t have any teams yet, please create a team first.

HTTP Request

POST https://api.connect.squiz.cloud/v2/components

Body Parameters

Parameter Required Description
type yes A value must be component
attributes.name yes Repository name
attributes.icon no Component icon as base64 string
relationships.team.data.id yes Team ID the repository to create for
relationships.team.data.type yes A value must be team
relationships.contract.data.id no Contract ID the repository to create for
relationships.contract.data.type no A value must be contract

Authorization

This request is authorized to a user with contracts.repository.edit permission.

Returns

Returns component’s metadata object if the call succeeded.

Update component

This resource allows you to perform the next actions:

  1. Change component’s access level from team to tenant. (Please note, that this action is irreversible i.e. API does not allow to change access back to team.)
  2. Change component’s whitelisted contract ids

Example Request:

curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID} \
   -X PATCH \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'
   -H 'Content-Type: application/json' -d '
   {
       "data": {
           "type": "component",
           "attributes": {
               "access": "tenant",
               "whitelisted_contract_ids": [
                 "{CONTRACT_ID}"
               ]
           }
       }
   }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"{COMPONENT_ID}",
    "type":"component",
    "links":{
      "self":"/v2/components/{COMPONENT_ID}"
    },
    "attributes":{
      "name":"name",
      "team_name":"team_name",
      "access": "tenant",
      "whitelisted_contract_ids": [
        "{CONTRACT_ID}"
      ]
    },
    "relationships":{
      "versions":{
        "links":{
          "related":"/v2/components/{COMPONENT_ID}/versions"
        }
      }
    }
  },
  "meta":{}
}

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}

URL Parameters

Parameter Required Description
COMPONENT_ID Yes Component identifier

Payload Parameters

Parameter Required Description
attributes.access no A value should be “tenant” for increasing access from team level
attributes.whitelisted_contract_ids no The ID’s of Contracts where given component should be accessible

Access level

A component may have one of the following access level:

Authorization

This request is authorized for a user with TenantAdmin role only. Contact support team to get this role.

Returns

Returns updated component’s metadata object if the call succeeded.

Delete a component

Example Request:

curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID} \
   -X DELETE \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 204 No Content
Content-Type: application/json

This resource allows you to delete a component. A component may only be delete if it not used in any flow.

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/

URL Parameters

Parameter Required Description
COMPONENT_ID yes Component ID

Authorization

This request is authorized to a user with contracts.repository.edit permission. The component must belong to one of the client’s team.

Returns

204 HTTP response code if the call succeeds, error otherwise.

Delete a version of the component

Example Request:

curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/{VERSION_ID} \
   -X DELETE \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 204 No Content
Content-Type: application/json

This resource allows you to delete a component version. A version of the component may only be deleted if it not used in any flow.

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/{VERSION_ID}

URL Parameters

Parameter Required Description
COMPONENT_ID yes Component ID
VERSION_ID yes Revision or version of the component’s build. Use latest to delete the most recent successful build.

Authorization

This request is authorized to a user with contracts.repository.edit permission. The component must belong to one of the user’s team.

Returns

204 HTTP response code if the call succeeds, error otherwise.

Retrieve component’s environment variables

Example Request:

curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/env \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "attributes":{
      "vars":{
        "MY_ENV_VAR":"env_var_value"
      }
    },
    "id":"{COMPONENT_ID}",
    "type":"component-env",
    "links":{
      "self":"/v2/component-envs/{COMPONENT_ID}"
    }
  },
  "meta":{}
}

This endpoint shows env vars for given component.

HTTP Request

GET https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/env

URL Parameters

Parameter Required Description
COMPONENT_ID yes Component ID

Authorization

The component should be accessible to the client (e.g. component from the own team or shared one).

Returns

Returns environment variables

Update component’s environment variables

Example Request:

curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/env \
   -X PUT \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json' -d '
   {
       "data": {
           "type": "component-env",
           "attributes": {
               "vars": {
                   "MY_ENV_VAR": "env_var_value"
               }
           }
       }
   }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "attributes":{
      "vars":{
        "MY_ENV_VAR":"env_var_value"
      }
    },
    "id":"{COMPONENT_ID}",
    "type":"component-env",
    "links":{
      "self":"/v2/component-envs/{COMPONENT_ID}"
    }
  },
  "meta":{}
}

This endpoint replaces env vars for given component.

HTTP Request

PUT https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/env

URL Parameters

Parameter Required Description
COMPONENT_ID yes Component ID

Body Parameters

Parameter Required Description
type yes A value must be component-env
attributes.vars yes JSON object representing environmental variables mapped to their values.

Authorization

The component should be accessible to the client (e.g. component from the own team or shared one).

Returns

Returns environment variables

Contracts

What is a Contract unit?

A Contract is a fundamental entity (scope) that reflects an agreement between a customer and the platform’s provider. The Contract scope can have an unlimited number of members, workspaces, and development teams. It also serves as a singular entity for the billing department against the consumed resources by all the integration flows. Every member of the Contract’s scope has a specific access level or role within the current Contract. To get all available roles, please execute the “Get the Contract’s roles” endpoint. The same user can have different roles in different Contracts within the Platform. Every Contract must have at least one Owner. The Owner’s Role has a predefined/default permissions’ set. It means this role cannot be deleted and the permissions’ set cannot be changed.

Please note that the Tenant Admin creates a Contract along with the Contract’s Owner. Once it’s done the Contract’s Owner will be able to invite other Users as well as assigning the necessary roles for them. (Tenant is a higher scope in the Platform’s hierarchy. It includes all the Contracts that belong to the white-label client).

Create a Contract

Example Request:

 curl https://api.connect.squiz.cloud/v2/contracts \
   -X POST \
   -u {EMAIL}:{APIKEY} \
   -H 'Content-Type: application/json' -d '
       {
        "data":{
          "type":"contract",
          "attributes":{
            "name":"My Contract",
            "support_user_id":"{{user_id}}",
            "available_roles":[
              {
                "scope":"contracts",
                "role":"admin"
              },
              {
                "scope":"workspaces",
                "role":"admin"
              }
            ]
          }
        }
      }'

Example Response:

HTTP/1.1 201 Created
Content-Type: application/json
{
  "data":{
    "id":"{CONTRACT_ID}",
    "type":"contract",
    "links":{
      "self":"/v2/contracts/{CONTRACT_ID}"
    },
    "attributes":{
      "name":"My Contract",
      "support_user_id":"{{user_id}}",
      "available_roles":[
        {
          "role":"admin",
          "scope":"contracts"
        },
        {
          "role":"owner",
          "scope":"contracts"
        },
        {
          "role":"admin",
          "scope":"workspaces"
        },
        {
          "role":"owner",
          "scope":"workspaces"
        }
      ],
      "status":"active"
    }
  },
  "meta":{}
}

This endpoint allows creating a Contract.

HTTP Request

POST https://api.connect.squiz.cloud/v2/contracts

Authorization

This request is authorized to only a user with TenantAdmin role.

Payload Parameters

Parameter Required Description
type yes A value should be “contract”
attributes.name yes Name of the Contract
attributes.flow_stats_enabled_default no Boolean true/false. Read more: Flow Stats Toggle
attributes.available_roles[] no The subset of Tenants roles the particular Contract belongs to
attributes.support_user_id no An ID of user from platform support team

Returns

Returns Contract object if the call succeeded

Update a Contract

Example Request:

 curl https://api.connect.squiz.cloud/v2/contracts/{CONTRACT_ID} \
   -X PATCH \
   -u {EMAIL}:{APIKEY} \
   -H 'Content-Type: application/json' -d '
       {
        "data":{
          "type":"contract",
          "id":"{CONTRACT_ID}"
          "attributes":{
             "name":"New Contract Name",
             "support_user_id":"{{user_id}}",
             "available_roles":[
              {
                "scope":"contracts",
                "role":"admin"
              },
              {
                "scope":"workspaces",
                "role":"admin"
              },
              {
                "scope":"workspaces",
                "role":"guest"
              }
            ]
          }
        }
      }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"{CONTRACT_ID}",
    "type":"contract",
    "links":{
      "self":"/v2/contracts/{CONTRACT_ID}"
    },
    "attributes":{
      "name":"New Contract Name",
      "support_user_id":"{{user_id}}",
      "available_roles":[
        {
          "role":"admin",
          "scope":"contracts"
        },
        {
          "role":"owner",
          "scope":"contracts"
        },
        {
          "role":"admin",
          "scope":"workspaces"
        },
        {
          "role":"guest",
          "scope":"workspaces"
        },
        {
          "role":"owner",
          "scope":"workspaces"
        }
      ],
      "status":"active"
    }
  },
  "meta":{}
}

This endpoint allows to change Contracts’ name and to update available roles in the Contract.

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/contracts/{CONTRACT_ID}

Authorization

For updating Contract name this request is authorized to the users with contracts.contract.edit permission. For updating the set of available roles of the particular Contract this request is authorized to the user with TenantAdmin role.

Payload Parameters

Parameter Required Description
type yes A value should be “contract”
attributes.name yes Name of the Contract
attributes.flow_stats_enabled_default no Boolean true/false. Read more: Flow Stats Toggle
attributes.available_roles[] no The subset of Tenants roles the particular Contract belongs to
attributes.support_user_id no An ID of user from platform support team

Returns

Returns Contract object if the call succeeded

Get Contract by Id

Example Request:

 curl https://api.connect.squiz.cloud/v2/contracts/{CONTRACT_ID}?include=members,invites \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"5b4f3e093a472b0006c71d47",
    "type":"contract",
    "links":{
      "self":"/v2/contracts/5b4f3e093a472b06c71d47"
    },
    "attributes":{
      "name":"LucontractOne",
      "available_roles": [],
      "status": "active"
    },
    "relationships":{
      "members":{
        "data":[
          {
            "id":"59d22eeb865b0018adc248",
            "type":"contract-member"
          },
          {
            "id":"5a1c298abe7a00189caf76",
            "type":"contract-member"
          }
        ],
        "links":{
          "self":"/v2/contracts/5b4f3e093a472b06c71d47/members/"
        }
      },
      "invites":{
        "data":[
          {
            "id":"5b6d8ce8033b0011fef43e",
            "type":"contract-invite"
          }
        ],
        "links":{
          "self":"/v2/contracts/5b4f3e093a4b0006c71d47/invites/"
        }
      }
    }
  },
  "meta":{},
  "included":[
    {
      "id":"59d22e7eebrr5b0018adc248",
      "type":"contract-member",
      "attributes":{
        "first_name":"Jane",
        "last_name":"Doe",
        "roles":[
          "admin"
        ],
        "email":"jane.doe@example.com"
      },
      "relationships":{
        "user":{
          "data":{
            "id":"59d22e7eeb865bee18adc248",
            "type":"user"
          },
          "links":{
            "self":"/v2/users/59d22e7eeb865bee18adc248"
          }
        }
      }
    },
    {
      "id":"5a1c298a75be7aee189caf76",
      "type":"contract-member",
      "attributes":{
        "first_name":"Henry",
        "last_name":"Pushkin",
        "roles":[
          "admin"
        ],
        "email":"henry@example.com"
      },
      "relationships":{
        "user":{
          "data":{
            "id":"5a1c298a75be7aee189caf76",
            "type":"user"
          },
          "links":{
            "self":"/v2/users/5a1c298a75be7aee189caf76"
          }
        }
      }
    }
  ],
  "links":{
    "self":"/v2/contracts/5b4f3e093a472b0ee6c71d47"
  }
}

This endpoint returns a Contract object for a specific contract’s id.

HTTP Request

GET https://api.connect.squiz.cloud/v2/contracts/CONTRACT_ID/

Authorization

A client has to be a member of the Contract’s scope or belong to the Tenant Admin users group (please contact our support department to get this specific role).

URL Parameters

Parameter Description
CONTRACT_ID The ID of the Contract

URL Query Parameters

Parameter Required Description
include no You may add a parameter, such as the ‘include’ for more detailed information regarding the Workspace’s entities. Possible values are members and/or invites.

Get Contracts

Example Request:

 curl https://api.connect.squiz.cloud/v2/contracts/
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":[
    {
      "id":"5b4f3379ff4305510483ba1a",
      "type":"contract",
      "links":{
        "self":"/v2/contracts/5b4f3379ff4304655483ba1a"
      },
      "attributes":{
        "name":"LuzhaOrg",
        "available_roles": [],
        "status": "active"
      },
      "relationships":{
        "members":{
          "data":[
            {
              "id":"5967519b2d8ff5501871dc39",
              "type":"contract-member"
            },
            {
              "id":"59bfb6958aa5555519ab26f1",
              "type":"contract-member"
            },
            {
              "id":"59d22e7eeb865b558adc248",
              "type":"contract-member"
            }
          ],
          "links":{
            "self":"/v2/contracts/5b4f3379ff455610483ba1a/members/"
          }
        }
      }
    },
    {
      "id":"5b76b1e104da8244038d5c9",
      "type":"contract",
      "links":{
        "self":"/v2/contracts/5b76b1e104da82441038d5c9"
      },
      "attributes":{
        "name":"FridayContract",
        "available_roles": [],
        "status": "active"
      },
      "relationships":{
        "members":{
          "data":[
            {
              "id":"5773e8e26e05f10ert0000003",
              "type":"contract-member"
            },
            {
              "id":"59d22e7eeb865berrt18adc248",
              "type":"contract-member"
            }
          ],
          "links":{
            "self":"/v2/contracts/5b76b1e104daer001038d5c9/members/"
          }
        }
      }
    }
  ],
  "meta":{}
}

This endpoint returns all the Contract’s objects for a specific user.

HTTP Request

GET https://api.connect.squiz.cloud/v2/contracts/

Query Parameters

Parameter Required Description
page[size] no Amount of items per page. Default is 20.
page[number] no Number of page you want to display. Default is 1.

Authorization

A client has to be a member of the Contract’s scope.

Get the Contract’s roles

Example Request:

 curl https://api.connect.squiz.cloud/v2/contracts/{CONTRACT_ID}/roles/ \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"{CONTRACT-POLICY_ID}",
    "type":"contract-policy",
    "attributes":{
      "roles":[
        {
          "i18n":{
            "en":"Admin"
          },
          "role":"admin",
          "permissions":[
            "contracts.membership.edit",
            "contracts.workspace.create",
            "contracts.workspace.listAll",
            "contracts.workspace.delete",
            "contracts.repository.edit",
            "contracts.devTeam.edit"
          ],
          "scope":"contracts"
        },
        {
          "i18n":{
            "en":"Member"
          },
          "role":"member",
          "permissions":[
            "contracts.workspace.create"
          ],
          "scope":"contracts"
        },
        {
          "i18n":{
            "en":"Admin"
          },
          "role":"admin",
          "permissions":[
            "workspaces.workspace.edit",
            "workspaces.flow.edit",
            "workspaces.flow.toggleStatus",
            "workspaces.flow.toggleRealtime",
            "workspaces.credential.edit"
          ],
          "scope":"workspaces"
        },
        {
          "i18n":{
            "en":"Integrator"
          },
          "role":"integrator",
          "permissions":[
            "workspaces.flow.edit",
            "workspaces.flow.toggleStatus",
            "workspaces.flow.toggleRealtime",
            "workspaces.credential.edit"
          ],
          "scope":"workspaces"
        },
        {
          "i18n":{
            "en":"Guest"
          },
          "role":"guest",
          "permissions":[],
          "scope":"workspaces"
        },
        {
          "i18n":{
            "en":"Custom_role"
          },
          "role":"custom_role",
          "permissions":[
            "workspaces.flow.edit",
            "workspaces.flow.toggleRealtime",
            "workspaces.credential.edit"
          ],
          "scope":"workspaces"
        },
        {
          "i18n":{
            "en":"Custom_role"
          },
          "role":"custom_role",
          "permissions":[
            "contracts.workspace.create",
            "contracts.devTeam.edit"
          ],
          "scope":"contracts"
        },
        {
          "i18n":{
            "en":"Owner"
          },
          "role":"owner",
          "permissions":[
            "contracts.membership.edit",
            "contracts.workspace.create",
            "contracts.workspace.listAll",
            "contracts.workspace.delete"
          ],
          "scope":"contracts"
        },
        {
          "i18n":{
            "en":"Owner"
          },
          "role":"owner",
          "permissions":[
            "workspaces.workspace.edit",
            "workspaces.flow.edit",
            "workspaces.flow.toggleStatus",
            "workspaces.flow.toggleRealtime",
            "workspaces.credential.edit"
          ],
          "scope":"workspaces"
        }
      ]
    },
    "relationships":{
      "contract":{
        "data":{
          "id":"{CONTRACT_ID}",
          "type":"contract"
        },
        "links":{
          "self":"/v2/contracts/{CONTRACT_ID}"
        }
      }
    }
  },
  "meta":{}
}

This endpoint returns a list of the contract roles for a specific Contract’s scope.

HTTP Request

GET https://api.connect.squiz.cloud/v2/contracts/CONTRACT_ID/roles/

Authorization

A client has to be a member of the Contract’s scope.

URL Parameters

Parameter Description
CONTRACT_ID The ID of the Contract

Suspend Contract

Example Request:

 curl https://api.connect.squiz.cloud/v2/contracts/{CONTRACT_ID}/suspend \
 -X POST \
 -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 202 Accepted

This endpoint allows suspending the Contract. The process is asynchronous. Suspending is completed once all of the flows in a given Contract will be stopped. While the Contract gets suspended, all the writing requests will be rejected.

HTTP Request

POST https://api.connect.squiz.cloud/v2/contracts/CONTRACT_ID/suspend/

Authorization

A client has to have the Service Account record type or the TenantAdmin role.

URL Parameters

Parameter Description
CONTRACT_ID The ID of the Contract

Unsuspend Contract

Example Request:

 curl https://api.connect.squiz.cloud/v2/contracts/{CONTRACT_ID}/unsuspend \
 -X POST \
 -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 204 No Content

This endpoint allows you to unsuspend the Contract.

HTTP Request

POST https://api.connect.squiz.cloud/v2/contracts/CONTRACT_ID/unsuspend/

Authorization

A client has to have the Service Account record type or the TenantAdmin role.

URL Parameters

Parameter Description
CONTRACT_ID The ID of the Contract

Delete Contract

Example Request:

 curl -i https://api.connect.squiz.cloud/v2/contracts/{CONTRACT_ID} \
  -X DELETE \
  -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 204 No Content

The endpoint deletes a Contract’s scope along with everything it includes. These items are listed below:

Note, the deletion process is asynchronous. The actual data deletion will be performed after an API response, as it requires time for termination of all the Contract’s flows containers. * *A Contract cannot be deleted while any of its Components are being used in another Contract Flow

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/contracts/{CONTRACT_ID} \

Authorization

This request is authorized for members with the Tenant Admin role.

URL Parameters

Parameter Description
CONTRACT_ID The ID of the Contract

Returns

Responds with the 204 No content message if the call succeeded (with empty body).

Credentials

Retrieve all credentials

Example Request:

curl https://api.connect.squiz.cloud/v2/credentials/?filter[component]={COMPONENT_ID}&workspace_id={WORKSPACE_ID} \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "meta":{},
  "data":[
    {
      "id":"585430d3f02852a8a9fac45e",
      "type":"credential",
      "links":{
        "self":"/v2/credentials/585430d3f02852a8a9fac45e"
      },
      "attributes":{
        "name":"CMS primary",
        "keys":{
          "oauth":{
            "key":"secret1"
          }
        }
      },
      "relationships":{
        "user":{
          "data":{
            "id":"585430d3f02852a8a9fac45d",
            "type":"user"
          },
          "links":{
            "self":"/v2/users/585430d3f02852a8a9fac45d"
          }
        },
        "component":{
          "data":{
            "id":"585430d2f02852a8a9fac456",
            "type":"component"
          },
          "links":{
            "self":"/v2/components/585430d2f02852a8a9fac456"
          }
        },
        "workspace":{
          "data":{
            "id":"59d341e9037f7200184a408b",
            "type":"workspace"
          },
          "links":{
            "self":"/v2/workspaces/59d341e9037f7200184a408b"
          }
        }
      }
    },
    {
      "id":"585430d3f02852a8a9fac45f",
      "type":"credential",
      "links":{
        "self":"/v2/credentials/585430d3f02852a8a9fac45f"
      },
      "attributes":{
        "name":"Refined CRM Manager login",
        "keys":{
          "oauth":{
            "key":"secret2"
          },
          "allowOption":"enabled"
        }
      },
      "relationships":{
        "user":{
          "data":{
            "id":"585430d3f02852a8a9fac45d",
            "type":"user"
          },
          "links":{
            "self":"/v2/users/585430d3f02852a8a9fac45d"
          }
        },
        "component":{
          "data":{
            "id":"585430d2f02852a8a9fac457",
            "type":"component"
          },
          "links":{
            "self":"/v2/components/585430d2f02852a8a9fac457"
          }
        },
        "workspace":{
          "data":{
            "id":"59d341e9037f7200184a408b",
            "type":"workspace"
          },
          "links":{
            "self":"/v2/workspaces/59d341e9037f7200184a408b"
          },
        },
        "vpn_agent":{
          "data":{
            "id":"59a410d76b670400182f190e",
            "type":"vpn-agent"
          },
          "links":{
            "self":"/v2/agents/vpn/59a410d76b670400182f190e"
          }
        }
      }
    }
  ],
  "links":{
    "self":"/v2/credentials"
  }
}

This resource allows you to retrieve all credentials belonging to user’s Workspace.

HTTP Request

GET https://api.connect.squiz.cloud/v2/credentials/?workspace_id={WORKSPACE_ID}&filter[component]={COMPONENT_ID}

Query Parameters

Parameter Required Description
workspace_id yes An Id of the Workspace
filter[component] No Only credentials belong to the given component id

Returns

Returns a list of credentials if the call succeeded.

Retrieve a credential by ID

Example Request:

curl https://api.connect.squiz.cloud/v2/credentials/{CREDENTIAL_ID}/ \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"59f9f2ba112f28001921f274",
    "type":"credential",
    "links":{
      "self":"/v2/credentials/59f9f2ba112f28001921f274"
    },
    "attributes":{
      "name":"SFTP account",
      "keys":{
        "host":"sftp.company.org",
        "username":"lord",
        "password":"teststetr"
      }
    },
    "relationships":{
      "user":{
        "data":{
          "id":"59f747c33f1d3c001901a44e",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/59f747c33f1d3c001901a44e"
        }
      },
      "component":{
        "data":{
          "id":"56793fb4d8057406000000f7",
          "type":"component"
        },
        "links":{
          "self":"/v2/components/56793fb4d8057406000000f7"
        }
      },
      "workspace":{
        "data":{
          "id":"59d341e9037f7200184a408b",
          "type":"workspace"
        },
        "links":{
          "self":"/v2/workspaces/59d341e9037f7200184a408b"
        }
      }
    }
  },
  "meta":{}
}

This resource allows you to retrieve a credential by its identifier.

HTTP Request

GET https://api.connect.squiz.cloud/v2/credentials/{CREDENTIAL_ID}/

URL Parameters

Parameter Required Description
CREDENTIAL_ID Yes Credential identifier

Returns

Returns a credential object if the call succeeded.

Create a credential

Example Request:

curl https://api.connect.squiz.cloud/v2/credentials/ \
    -X POST \
    -u {EMAIL}:{APIKEY} \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' -d '
    {
     "data":{
       "type":"credential",
       "attributes":{
         "name":"credname",
         "keys":{
           "host":"hostname",
           "username":"username",
           "password":"pass"
         }
       },
       "relationships":{
         "component":{
           "data":{
             "id":"56793fb4d8057406000000f7",
             "type":"component"
           }
         },
         "workspace":{
           "data":{
             "id":"59d341e9037f7200184a408b",
             "type":"workspace"
           }
         }
       }
     }
   }'

Example Response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "data":{
    "id":"5abe11edbec1cf00078b81d1",
    "type":"credential",
    "links":{
      "self":"/v2/credentials/5abe11edbec1cf00078b81d1"
    },
    "attributes":{
      "name":"credname",
      "keys":{
        "host":"hostname",
        "username":"username",
        "password":"pass"
      }
    },
    "relationships":{
      "user":{
        "data":{
          "id":"59d3562c68ed850019bde27f",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/59d3562c68ed850019bde27f"
        }
      },
      "component":{
        "data":{
          "id":"56793fb4d8057406000000f7",
          "type":"component"
        },
        "links":{
          "self":"/v2/components/56793fb4d8057406000000f7"
        }
      },
      "workspace":{
        "data":{
          "id":"59d341e9037f7200184a408b",
          "type":"workspace"
        },
        "links":{
          "self":"/v2/workspaces/59d341e9037f7200184a408b"
        }
      },
      "vpn_agent":{
        "data":{
          "id":"5a09deda2d5f49665afb739a",
          "type":"vpn-agent"
        },
        "links":{
          "self":"/v2/agents/vpn/5a09deda2d5f49665afb739a"
        }
      }
    }
  },
  "meta":{}
}

This resource allows you to create a credential.

HTTP Request

POST https://api.connect.squiz.cloud/v2/credentials/

Body Parameters

Parameter Required Description
type yes A value must be credential
attributes.name no Credential name. An automatic name will be generated if the parameter is omitted
attributes.keys no An object which represents component’s configuration (OAuth keys, etc.). Read more below
relationships.component.data.id yes The component id this credential is for
relationships.component.data.type yes A value must be component
relationships.workspace.data.id yes The Workspace id this credential is for
relationships.workspace.data.type yes A value must be workspace
relationships.vpn_agent no The vpn agent relation object
relationships.vpn_agent.data.id no The vpn agent id this credential is for
relationships.vpn_agent.data.type no A value must be vpn-agent

attributes.keys structure

API attributes.keys structure depends on credentials.fields property of component’s component.json. The keys from credentials.fields directly translate into keys of attributes.keys.

Definition from credentials.fields:

Definition from credentials fields

Expected attributes.keys:

Expected attributes keys

The value structure of a key in attributes.keys depends on viewClass. The structure of most frequently used view classes:

object with structure

Note. This view must be the only view in a credentials.fields list and its key must be auth, so attributes.keys will look like:

will look like

Authorization

This request is authorized to only a user with workspaces.credential.edit permission

Returns

Returns credential object if the call succeeded.

Update a credential

Example Request:

curl https://api.connect.squiz.cloud/v2/credentials/{CREDENTIAL_ID}/ \
   -u {EMAIL}:{APIKEY} \
   -X PATCH \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json' -d '
    {
        "data": {
            "id": "585430d3f02852a8a9fac45e",
            "type": "credential",
            "attributes": {
                "keys": {
                    "key1": "updated value"
                }
            },
            "relationships": {
               "vpn_agent": {
                   "data": {
                       "id": "59a410d76b670400182f190e",
                       "type": "vpn-agent"
                    }
                }
            }
           }
        }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"5aaff19dbd6d6400079b4624",
    "type":"credential",
    "links":{
      "self":"/v2/credentials/5aaff19dbd6d6400079b4624"
    },
    "attributes":{
      "name":"luzho4ek777",
      "keys":{
        "host":"sftp.company.org",
        "username":"asssssa",
        "password":"qweqweqw"
      }
    },
    "relationships":{
      "user":{
        "data":{
          "id":"59d3562c68ed850019bde27f",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/59d3562c68ed850019bde27f"
        }
      },
      "component":{
        "data":{
          "id":"56793fb4d8057406000000f7",
          "type":"component"
        },
        "links":{
          "self":"/v2/components/56793fb4d8057406000000f7"
        }
      },
      "workspace":{
        "data":{
          "id":"59d341e9037f7200184a408b",
          "type":"workspace"
        },
        "links":{
          "self":"/v2/workspaces/59d341e9037f7200184a408b"
        }
      },
      "vpn_agent":{
        "data":{
          "id":"5a09deda2d5f49665afb739a",
          "type":"vpn-agent"
        },
        "links":{
          "self":"/v2/agents/vpn/5a09deda2d5f49665afb739a"
        }
      }
    }
  },
  "meta":{}
}

This resource allows you to update a credential.

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/credentials/{CREDENTIAL_ID}/

URL Parameters

Parameter Required Description
CREDENTIAL_ID yes Credential ID

Body Parameters

Parameter Required Description
id yes A value must be the same as URL parameter CREDENTIAL_ID
type yes A value must be credential
attributes.name no Credential name. Will remain untouched if value omitted.
attributes.keys no An object which represents component’s configuration. Will remain untouched if value omitted. Please note, that keys object is overwritten entirely.
relationships.vpn_agent no The vpn agent relation object. Will remain untouched if omitted.
relationships.vpn_agent.data.id no The vpn agent id this credential is for.
relationships.vpn_agent.data.type no A value must be vpn-agent

Authorization

This request is authorized to only a user with workspaces.credential.edit permission

Returns

Returns a modified credential object if the call succeeded.

Delete a credential

Example Request:

curl https://api.connect.squiz.cloud/v2/credentials/{CREDENTIAL_ID}/ \
   -X DELETE \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 204 No Content

This resource allows you to delete a credential.

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/credentials/{CREDENTIAL_ID}/

URL Parameters

Parameter Required Description
CREDENTIAL_ID yes Credential ID

Authorization

This request is authorized to only a user with workspaces.credential.edit permission

Returns

204 HTTP response code if the call succeeds, error otherwise.

Data samples

Retrieve data sample

This resource allows you to retrieve data sample.

Example Request:

 curl https://api.connect.squiz.cloud/v2/data-samples/{DATASAMPLE_ID} \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Request with filter:

 curl https://api.connect.squiz.cloud/v2/data-samples?filter[id]={DATASAMPLE_ID1},{DATASAMPLE_ID2} \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"{DATASAMPLE_ID}",
    "type":"data-sample",
    "links":{
      "self":"/v2/data-samples/585d389b90ea62ce348a478b"
    },
    "relationships":{
      "component_version":{
        "data":{
          "id":"latest",
          "type":"version"
        },
        "links":{
          "self":"/v2/components/5863f7136ef9da255ad9a9bc/versions/latest"
        }
      },
      "workspace":{
        "data":{
          "id":"59d341e9037f7200184a408b",
          "type":"workspace"
        },
        "links":{
          "self":"/v2/workspaces/59d341e9037f7200184a408b"
        }
      },
      "component":{
        "data":{
          "id":"5863f7136ef9da255ad9a9bc",
          "type":"component"
        },
        "links":{
          "self":"/v2/components/5863f7136ef9da255ad9a9bc"
        }
      },
      "user":{
        "data":{
          "id":"585d389b90ea62ce348a478b",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/585d389b90ea62ce348a478b"
        }
      }
    },
    "attributes":{
      "method":"hello123",
      "result":{
        "foo":"bar1",
        "baz":"qwe1"
      }
    }
  },
  "meta":{}
}

Authorization

A member of a Workspace can get any sample from own Workspace.

HTTP Request

GET https://api.connect.squiz.cloud/v2/data-samples/{DATASAMPLE_ID}

Create data sample

Example Request:

 curl https://api.connect.squiz.cloud/v2/data-samples \
   -X POST \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json' -d '
    {
    "data":{
        "type":"data-sample",
      "attributes":{
        "method":"hello123",
       "result":{
         "foo":"bar",
          "baz":"foo"
        }
      },
      "relationships":{
         "component":{
          "data":{
            "id":"5863f7136ef9da255ad9a9bc",
            "type":"component"
         }
          },
        "component_version":{
           "data":{
             "id":"latest",
             "type":"version"
           }
         },
          "workspace":{
            "data":{
              "id":"59d341e9037f7200184a408b",
             "type":"workspace"
           }
       }
      }
     }
    }'

Example Response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "data":{
    "id":"585d389b90ea62ce348a478b",
    "type":"data-sample",
    "links":{
      "self":"/v2/data-samples/585d389b90ea62ce348a478b"
    },
    "relationships":{
      "component_version":{
        "data":{
          "id":"latest",
          "type":"version"
        },
        "links":{
          "self":"/v2/components/5863f7136ef9da255ad9a9bc/versions/latest"
        }
      },
      "workspace":{
        "data":{
          "id":"59d341e9037f7200184a408b",
          "type":"workspace"
        },
        "links":{
          "self":"/v2/workspaces/59d341e9037f7200184a408b"
        }
      },
      "component":{
        "data":{
          "id":"5863f7136ef9da255ad9a9bc",
          "type":"component"
        },
        "links":{
          "self":"/v2/components/5863f7136ef9da255ad9a9bc"
        }
      },
      "user":{
        "data":{
          "id":"585d389b90ea62ce348a478b",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/585d389b90ea62ce348a478b"
        }
      }
    },
    "attributes":{
      "method":"hello123",
      "result":{
        "foo":"bar1",
        "baz":"qwe1"
      }
    }
  },
  "meta":{}
}

HTTP Request

POST https://api.connect.squiz.cloud/v2/data-samples

Body Parameters

Parameter Required Description
type yes A value must be data-sample
attributes.method yes Component’s action or trigger name.
attributes.result yes Data sample body
relationships.component.data.id yes Component’s id
relationships.component_version.data.id yes Revision of the component’s build. Use latest to retrieve the descriptor of the most recent successful build.
relationships.workspace.data.id yes An Id of the Wokspace
relationships.workspace.data.type yes A value must be workspace

Authorization

A member of a Workspace with permission workspaces.flow.edit can create a sample in own Workspace.

Returns

Returns data sample object if the call succeeded.

Update data sample

Example Request:

 curl https://api.connect.squiz.cloud/v2/data-samples/{DATASAMPLE_ID} \
   -X PATCH \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json' -d '
   {
        "data": {
            "type": "data-sample",
            "attributes": {
                "method": "hello123",
                "result": {
                    "foo": "bar",
                    "baz": "foo"
                }
            }
        }
    }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"585d389b90ea62ce348a478b",
    "type":"data-sample",
    "links":{
      "self":"/v2/data-samples/585d389b90ea62ce348a478b"
    },
    "relationships":{
      "component_version":{
        "data":{
          "id":"latest",
          "type":"version"
        },
        "links":{
          "self":"/v2/components/5863f7136ef9da255ad9a9bc/versions/latest"
        }
      },
      "workspace":{
        "data":{
          "id":"59d341e9037f7200184a408b",
          "type":"workspace"
        },
        "links":{
          "self":"/v2/workspaces/59d341e9037f7200184a408b"
        }
      },
      "component":{
        "data":{
          "id":"5863f7136ef9da255ad9a9bc",
          "type":"component"
        },
        "links":{
          "self":"/v2/components/5863f7136ef9da255ad9a9bc"
        }
      },
      "user":{
        "data":{
          "id":"585d389b90ea62ce348a478b",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/585d389b90ea62ce348a478b"
        }
      }
    },
    "attributes":{
      "method":"hello123",
      "result":{
        "foo":"bar",
        "baz":"foo"
      }
    }
  },
  "meta":{}
}

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/data-samples/{DATASAMPLE_ID}

Body Parameters

Parameter Required Description
type yes A value must be data-sample
attributes.result no Data sample body

Authorization

A member of a Workspace with permission workspaces.flow.edit can update a sample in own Workspace.

Returns

Returns updated data sample object if the call succeeded.

Flow drafts

Retrieve a flow draft

Example Request:

 curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/draft \
   -X GET \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"5abe0cabaa56a1749856226b",
    "type":"flow-draft",
    "links":{
      "self":"/v2/flows/5abbb9d4bc984b000739761a/draft"
    },
    "attributes":{
      "name":"2803ANode.js Code to E-Mail",
      "description":null,
      "cron":null,
      "graph":{
        "nodes":[
          {
            "id":"step_1",
            "command":"squiz-apidocs/timer:timer@latest",
            "name":"",
            "description":"",
            "vpn_agent_id":"5a09deda2d5f49665afb739a",
            "fields":{
              "interval":"minute"
            }
          },
          {
            "id":"step_2",
            "command":"squiz-apidocs/email:send@latest",
            "name":"",
            "description":"",
            "vpn_agent_id":"5a09deda2d5f49665afb739a"
          },
          {
            "id":"step_3",
            "command":"squiz-apidocs/code:execute@latest",
            "name":"",
            "description":"",
            "vpn_agent_id":"5a09deda2d5f49665afb739a",
            "fields":{
              "code":"//Your NodeJS code"
            }
          }
        ],
        "edges":[
          {
            "id":"step_1:step_3",
            "source":"step_1",
            "target":"step_3"
          },
          {
            "id":"mapper:step_3:step_2",
            "config":{
              "mapper_type":"jsonata",
              "condition":null,
              "mapper":{
                "textBody":"message",
                "subject":"\"2803_SW)RT\"",
                "to":"\"test@example.com\""
              }
            },
            "source":"step_3",
            "target":"step_2"
          }
        ]
      },
      "created_at":"2018-03-30T10:08:43.582Z",
      "updated_at":"2018-03-30T10:08:43.582Z"
    },
    "relationships":{
      "user":{
        "data":{
          "id":"59d3562c68ed850019bde27f",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/59d3562c68ed850019bde27f"
        }
      },
      "flow":{
        "data":{
          "id":"5abbb9d4bc984b000739761a",
          "type":"flow"
        },
        "links":{
          "self":"/v2/flows/5abbb9d4bc984b000739761a"
        }
      }
    }
  },
  "meta":{}
}

This resource allows you to get a flow draft.

HTTP Request

GET https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/draft

URL Parameters

Parameter Required Description
FLOW_ID yes Flow ID

Returns

Returns a flow draft

Create/update a flow draft

Example Request:

 curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/draft \
   -X PUT \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json' -d '
    {
      "data": {
        "type": "flow-draft",
        "attributes": {
          "name": "Timer to E-Mail",
          "description": "Some real description",
          "graph": {
            "nodes": [
              {
                "id": "step_1",
                "command": "squiz-apidocs/timer:timer",
                "fields": {
                  "interval": "minute"
                }
              },
              {
                "id": "step_2",
                "command": "squiz-apidocs/email:send"
              }
            ],
            "edges": [
              {
                "source": "step_1",
                "target": "step_2",
                "config": {
                  "mapper": {
                    "to": "info@acme.org",
                    "subject": "Test",
                    "textBody": "{{fireTime}}"
                  }
                }
              }
            ]
          }
        }
      }
    }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"5abe0cabaa56a1749856226b",
    "type":"flow-draft",
    "links":{
      "self":"/v2/flows/5abbb9d4bc984b000739761a/draft"
    },
    "attributes":{
      "name":"2803ANode.js Code to E-Mail",
      "description":null,
      "cron":null,
      "graph":{
        "nodes":[
          {
            "id":"step_1",
            "command":"squiz-apidocs/timer:timer@latest",
            "name":"",
            "description":"",
            "vpn_agent_id":"5a09deda2d5f49665afb739a",
            "fields":{
              "interval":"minute"
            }
          },
          {
            "id":"step_2",
            "command":"squiz-apidocs/email:send@latest",
            "name":"",
            "description":"",
            "vpn_agent_id":"5a09deda2d5f49665afb739a"
          },
          {
            "id":"step_3",
            "command":"squiz-apidocs/code:execute@latest",
            "name":"",
            "description":"",
            "vpn_agent_id":"5a09deda2d5f49665afb739a",
            "fields":{
              "code":"//Your NodeJS code"
            }
          }
        ],
        "edges":[
          {
            "id":"step_1:step_3",
            "source":"step_1",
            "target":"step_3"
          },
          {
            "id":"mapper:step_3:step_2",
            "config":{
              "mapper_type":"jsonata",
              "condition":null,
              "mapper":{
                "textBody":"message",
                "subject":"\"2803_SW)RT\"",
                "to":"\"test@example.com\""
              }
            },
            "source":"step_3",
            "target":"step_2"
          }
        ]
      },
      "created_at":"2018-03-30T10:08:43.582Z",
      "updated_at":"2018-03-30T10:08:43.582Z"
    },
    "relationships":{
      "user":{
        "data":{
          "id":"59d3562c68ed850019bde27f",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/59d3562c68ed850019bde27f"
        }
      },
      "flow":{
        "data":{
          "id":"5abbb9d4bc984b000739761a",
          "type":"flow"
        },
        "links":{
          "self":"/v2/flows/5abbb9d4bc984b000739761a"
        }
      }
    }
  },
  "meta":{}
}

This resource allows you to create/update a flow draft.

HTTP Request

PUT https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/draft

URL Parameters

Parameter Required Description
FLOW_ID yes Flow ID

Body Parameters

Parameter Required Description
type yes A value must be flow-draft
attributes.name no Flow name
attributes.description no Flow description
attributes.graph no Flow graph representing component connections
attributes.cron no Cron expression
attributes.stats_enabled no Boolean true/false. Read more: Flow Stats Toggle

Returns

Returns the created/updated flow draft

Delete a flow draft

Example Request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/draft \
   -X DELETE \
   -u {EMAIL}:{APIKEY}

This resource allows you to delete a flow draft.

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/draft

URL Parameters

Parameter Required Description
FLOW_ID yes Flow ID

Example Response:

HTTP/1.1 204 No Content

Flow versions

Retrieve all flow versions

Example Request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/versions?page[size]=20&page[number]=1 \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":[
    {
      "id":"af65130306caf1c421708a1cfe7edcb56900a6af",
      "type":"flow-version",
      "links":{
        "self":"/v2/flows/5ab0eeabbd6d6400079b4628/versions/af65130306caf1c421708a1cfe7edcb56900a6af"
      },
      "attributes":{
        "name":"Node.js Code to Node.js Code draft 2",
        "description":null,
        "graph":{
          "nodes":[
            {
              "id":"step_1",
              "command":"squiz-apidocs/code:executeTrigger@latest",
              "name":"",
              "description":"",
              "fields":{
                "code":"//Your NodeJS code"
              }
            },
            {
              "id":"step_2",
              "command":"squiz-apidocs/code:execute@latest",
              "name":"",
              "description":"",
              "fields":{
                "code":"// Your NodeJS code"
              }
            },
            {
              "id":"step_3",
              "command":"squiz-apidocs/code:execute@latest",
              "name":"",
              "description":"",
              "fields":{
                "code":"// Your NodeJS code"
              }
            }
          ],
          "edges":[
            {
              "id":"step_1:step_2",
              "source":"step_1",
              "target":"step_2"
            },
            {
              "id":"step_1:step_3",
              "source":"step_1",
              "target":"step_3"
            }
          ]
        },
        "created_at":"2018-03-20T14:12:54.361Z"
      },
      "relationships":{
        "user":{
          "data":{
            "id":"59d22e7eeb865b0018adc248",
            "type":"user"
          },
          "links":{
            "self":"/v2/users/59d22e7eeb865b0018adc248"
          }
        },
        "flow":{
          "data":{
            "id":"5ab0eeabbd6d6400079b4628",
            "type":"flow"
          },
          "links":{
            "self":"/v2/flows/5ab0eeabbd6d6400079b4628"
          }
        }
      }
    }
  ],
  "meta":{
    "page":1,
    "per_page":50,
    "total":1,
    "total_pages":1
  }
}

These versions represent the history of changes of the flow and are sorted chronologically by created_at.

Each version has an id and represents a flow’s state at the given created_at time. It also exposes a relationship to the author of the change.

HTTP Request

GET https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/versions

URL Parameters

Parameter Required Description Default
FLOW_ID Yes Flow identifier
page[size] No Amount of items per page 50
page[number] No Number of page you want to display 1

Returns

The list of versions for the specified flow.

Retrieve flow version by hash

Example Request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/versions/{VERSION_HASH} \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"af65130306caf1c421708a1cfe7edcb56900a6af",
    "type":"flow-version",
    "links":{
      "self":"/v2/flows/5ab0eeabbd6d6400079b4628/versions/af65130306caf1c421708a1cfe7edcb56900a6af"
    },
    "attributes":{
      "name":"Node.js Code to Node.js Code draft 2",
      "description":null,
      "graph":{
        "nodes":[
          {
            "id":"step_1",
            "command":"squiz-apidocs/code:executeTrigger@latest",
            "name":"",
            "description":"",
            "fields":{
              "code":"//Your NodeJS code"
            }
          },
          {
            "id":"step_2",
            "command":"squiz-apidocs/code:execute@latest",
            "name":"",
            "description":"",
            "fields":{
              "code":"// Your NodeJS code"
            }
          },
          {
            "id":"step_3",
            "command":"squiz-apidocs/code:execute@latest",
            "name":"",
            "description":"",
            "fields":{
              "code":"// Your NodeJS code"
            }
          }
        ],
        "edges":[
          {
            "id":"step_1:step_2",
            "source":"step_1",
            "target":"step_2"
          },
          {
            "id":"step_1:step_3",
            "source":"step_1",
            "target":"step_3"
          }
        ]
      },
      "created_at":"2018-03-20T14:12:54.361Z"
    },
    "relationships":{
      "user":{
        "data":{
          "id":"59d22e7eeb865b0018adc248",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/59d22e7eeb865b0018adc248"
        }
      },
      "flow":{
        "data":{
          "id":"5ab0eeabbd6d6400079b4628",
          "type":"flow"
        },
        "links":{
          "self":"/v2/flows/5ab0eeabbd6d6400079b4628"
        }
      }
    }
  },
  "meta":{}
}

This resource allows to you retrieve specific version of the flow by its version hash.

HTTP Request

GET https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/versions/{VERSION_HASH}

URL Parameters

Parameter Required Description
FLOW_ID Yes Flow identifier
VERSION_HASH Yes Version hash

Returns

Specific version of the flow.

Flows

Flow Stats Toggle

By default each step of a flow generates stats about input/output messages and errors. You can see them on the Executions and Dashboard pages. To disable input/output message stats and you can set flow’s attributes.stats_enabled flag to false.

If you want to disable stats for all newly created flows of a workspace/contract/tenant, set attributes.flow_stats_enabled_default property of a target workspace/contract/tenant to false. This property is cascade. E.g. if on flow creation it’s not defined or true for workspace, we will look for contract. If it’s not defined or true for contract, we will look for tenant. If it’s not defined or true for tenant, flow will have attributes.stats_enabled = true. So we search upwards until see the first false, otherwise stats will be enabled.

Retrieve all flows

Example Request (with custom paging):

 curl 'https://api.connect.squiz.cloud/v2/flows?workspace_id=59d341e9037f7200184a408b&page[size]=20&page[number]=1' \
   -g -u {EMAIL}:{APIKEY}

Example Request (with filter):

 curl 'https://api.connect.squiz.cloud/v2/flows?workspace_id=59d341e9037f7200184a408b&filter[status]=active' \
   -g -u {EMAIL}:{APIKEY}

Example Request (with search):

 curl 'https://api.connect.squiz.cloud/v2/flows?workspace_id=59d341e9037f7200184a408b&search=webhook' \
   -g -u {EMAIL}:{APIKEY}

Example Request (with custom sorting):

 curl 'https://api.connect.squiz.cloud/v2/flows?workspace_id=59d341e9037f7200184a408b&sort=-updated_at' \
   -g -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":[
    {
      "type":"flow",
      "id":"585918da586224001b96de89",
      "links":{
        "self":"/v2/flows/585918da586224001b96de89"
      },
      "attributes":{
        "name":"Timer to E-Mail Test",
        "status":"inactive",
        "type":"ordinary",
        "created_at":"2018-03-27T15:39:02.825Z",
        "current_status":"inactive",
        "default_mapper_type":"jsonata",
        "description":"",
        "updated_at":"2018-03-27T15:39:02.923Z",
        "graph":{
          "nodes":[
            {
              "id":"step_1",
              "component_id": "55ba18e35d04040500000004",
              "command":"squiz-apidocs/timer:timer",
              "name":"",
              "description":"",
              "fields":{
                "interval":"minute"
              }
            },
            {
              "id":"step_2",
              "component_id": "593809a16b1d1f00196b74cd",
              "command":"squiz-apidocs/email:send",
              "name":"",
              "description":""
            }
          ],
          "edges":[
            {
              "id":"mapper:step_1:step_2",
              "config":{
                "mapper_type":"jsonata",
                "condition":null,
                "mapper":{
                  "to":"\"test@example.com\"",
                  "subject":"\"StrongMapper\"",
                  "textBody":"Address.Street"
                }
              },
              "source":"step_1",
              "target":"step_2"
            }
          ]
        }
      },
      "relationships":{
        "user":{
          "data":{
            "type":"user",
            "id":"560e5a27734d480a00000002"
          },
          "links":{
            "self":"/v2/users/560e5a27734d480a00000002"
          }
        },
        "workspace":{
          "data":{
            "type":"workspace",
            "id":"573dd76962436c349f000003"
          },
          "links":{
            "self":"/v2/workspaces/573dd76962436c349f000003"
          }
        },
        "versions":{
          "links":{
            "related":"/v2/flows/585918da586224001b96de89/versions"
          }
        },
        "latest_version":{
          "data":{
            "id":"787513ee82625ef46bc10372cb6485a535b54c5f",
            "type":"flow-version"
          },
          "links":{
            "self":"/v2/flows/585918da586224001b96de89/versions/787513ee82625ef46bc10372cb6485a535b54c5f",
            "related":"/v2/flows/585918da586224001b96de89/versions/787513ee82625ef46bc10372cb6485a535b54c5f"
          }
        }
      }
    }
  ],
  "meta":{
    "page":1,
    "per_page":10,
    "total":2,
    "total_pages":1
  },
  "links":{
    "self":"/v2/flows"
  }
}

This resource allows you to retrieve flows.

HTTP Request

GET https://api.connect.squiz.cloud/v2/flows/

Query Parameters

Parameter Required Description
workspace_id yes An Id of the Workspace
page[size] no Amount of items per page. Default is 50.
page[number] no Number of page you want to display. Default is 1.
filter[has_draft] no Filter flows only with or without a draft. May be true or false.
filter[status] no Filter by status. May be any of: active, inactive.
filter[type] no Filter by flow type. May be any of: ordinary, long_running.
filter[user] no Filter by user. Must be id of User who created the flow. User could be found in relationships of the flow.
sort no Sort flows list by certain field. May be created_at, updated_at or name. Prefix field name with - for reversed (desc) order e.g. sort=-updated_at. Default sort is by id.
search no Search flows by a word or a phrase contained in a description OR in a name. Behavior is similar to operator LIKE in SQL. Case insensitive. Leading/following spaces are trimmed.

Returns

Returns all flows in the specified Workspace.

Retrieve a flow by ID

Example Request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID} \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "type":"flow",
    "id":"585918da586224001b96de89",
    "links":{
      "self":"/v2/flows/585918da586224001b96de89"
    },
    "attributes":{
      "name":"Timer to E-Mail Test",
      "status":"inactive",
      "type":"ordinary",
      "created_at":"2018-03-27T15:39:02.825Z",
      "current_status":"inactive",
      "default_mapper_type":"jsonata",
      "description":"",
      "updated_at":"2018-03-27T15:39:02.923Z",
      "graph":{
        "nodes":[
          {
            "id":"step_1",
            "component_id": "55ba18e35d04040500000004",
            "command":"squiz-apidocs/timer:timer",
            "name":"",
            "description":"",
            "fields":{
              "interval":"minute"
            }
          },
          {
            "id":"step_2",
            "component_id": "593809a16b1d1f00196b74cd",
            "command":"squiz-apidocs/email:send",
            "name":"",
            "description":""
          }
        ],
        "edges":[
          {
            "id":"mapper:step_1:step_2",
            "config":{
              "mapper_type":"jsonata",
              "condition":null,
              "mapper":{
                "to":"\"test@example.com\"",
                "subject":"\"StrongMapper\"",
                "textBody":"Address.Street"
              }
            },
            "source":"step_1",
            "target":"step_2"
          }
        ]
      }
    },
    "relationships":{
      "user":{
        "data":{
          "type":"user",
          "id":"560e5a27734d480a00000002"
        },
        "links":{
          "self":"/v2/users/560e5a27734d480a00000002"
        }
      },
      "workspace":{
        "data":{
          "type":"workspace",
          "id":"573dd76962436c349f000003"
        },
        "links":{
          "self":"/v2/workspaces/573dd76962436c349f000003"
        }
      },
      "versions":{
        "links":{
          "related":"/v2/flows/585918da586224001b96de89/versions"
        }
      },
      "latest_version":{
        "data":{
          "id":"787513ee82625ef46bc10372cb6485a535b54c5f",
          "type":"flow-version"
        },
        "links":{
          "self":"/v2/flows/585918da586224001b96de89/versions/787513ee82625ef46bc10372cb6485a535b54c5f",
          "related":"/v2/flows/585918da586224001b96de89/versions/787513ee82625ef46bc10372cb6485a535b54c5f"
        }
      }
    }
  },
  "meta":{}
}

This resource allows you to retrieve a flow by its identifier. If the flow with given ID does not belong to the current user or to one of his Workspace, an error is returned.

HTTP Request

GET https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}

URL Parameters

Parameter Required Description
FLOW_ID Yes Flow identifier

Returns

The flow with given ID

Create a flow

Example Request:

 curl -X POST https://api.connect.squiz.cloud/v2/flows \
  -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json' -d '
   {
    "data":{
    "attributes":{
      "default_mapper_type":"jsonata",
      "type":"ordinary",
      "name":"My flow",
      "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
      "cron":null,
      "graph":{
        "nodes":[
          {
            "name":"",
            "description":"",
            "command":"components/simple-trigger-component:timer@latest",
            "fields":{

            },
            "id":"step_1",
            "selected_data_samples":[
              "{DATA_SAMPLE_ID}"
            ]
          },
          {
            "name":"My component",
            "description":"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
            "command":"components/code:execute@latest",
            "fields":{
              "code":"{{Put your custom Node.js code here}}"
            },
            "id":"step_2",
            "vpn_agent_id":"{VPN_AGENT_ID}",
            "selected_data_samples":[
              "{DATA_SAMPLE_ID}"
            ]
          },
          {
            "name":"",
            "description":"",
            "command":"help/petstore:createPetWithPromise@latest",
            "fields":{

            },
            "id":"step_3",
            "credentials_id":"{CREDENTIAL_ID}",
            "selected_data_samples":[
              "{DATA_SAMPLE_ID}"
            ]
          },
          {
            "name":"",
            "description":"",
            "command":"help/petstore:createPetWithPromise@latest",
            "fields":{

            },
            "id":"step_4",
            "credentials_id":"{CREDENTIAL_ID}",
            "selected_data_samples":[
              "{DATA_SAMPLE_ID}"
            ]
          }
        ],
        "edges":[
          {
            "config":{
              "mapper":{

              },
              "condition":null
            },
            "source":"step_1",
            "target":"step_2"
          },
          {
            "config":{
              "mapper_type":"jsonata",
              "mapper":{
                "status":"\"sold\"",
                "name":"result"
              },
              "condition":null
            },
            "source":"step_2",
            "target":"step_3"
          },
          {
            "config":{
              "mapper_type":"jsonata",
              "mapper":{
                "status":"\"pending\"",
                "name":"result"
              },
              "condition":null
            },
            "source":"step_2",
            "target":"step_4"
          }
        ]
      },
      "nodes_config": {
        "step_1": {
          "passthrough": {
            "disabled": true
          }
        },
        "step_2": {
          "prefetch": 3,
          "replicas": 2,
          "disable_dynamic_flow_control": true,
          "log_level": "info"
        }
      }
    },
    "relationships":{
      "workspace":{
        "data":{
          "type":"workspace",
          "id":"{WORKSPACE_ID}"
        }
      }
    },
    "type":"flow"
  }'

Example Response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "data":{
    "id":"{FLOW_ID}",
    "type":"flow",
    "links":{
      "self":"/v2/flows/{FLOW_ID}"
    },
    "attributes":{
      "api_version":"2.0",
      "created_at":"2019-06-27T14:28:17.918Z",
      "current_status":"inactive",
      "default_mapper_type":"jsonata",
      "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
      "graph":{
        "nodes":[
          {
            "id":"step_1",
            "component_id":"{COMPONENT_ID}",
            "command":"components/simple-trigger-component:timer@latest",
            "name":"",
            "description":"",
            "selected_data_samples":[
              "{DATA_SAMPLE_ID}"
            ]
          },
          {
            "id":"step_2",
            "component_id":"{COMPONENT_ID}",
            "command":"components/code:execute@latest",
            "name":"My component",
            "description":"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
            "vpn_agent_id":"{VPN_AGENT_ID}",
            "fields":{
              "code":"// Please note only Node.js code is supported here\nasync function run(msg) {\n\tconsole.log('Incoming message is %s', JSON.stringify(msg));\n\tconst body = { result : 'Hello world!' };\n\t// You can emit as many data messages as required\n\tawait this.emit('data', { body });\n\tconsole.log('Execution finished');\n}"
            },
            "selected_data_samples":[
              "{DATA_SAMPLE_ID}"
            ]
          },
          {
            "id":"step_3",
            "component_id":"{COMPONENT_ID}",
            "command":"help/petstore:createPetWithPromise@latest",
            "name":"",
            "description":"",
            "credentials_id":"{CREDENTIAL_ID}",
            "selected_data_samples":[
              "{DATA_SAMPLE_ID}"
            ]
          },
          {
            "id":"step_4",
            "component_id":"{COMPONENT_ID}",
            "command":"help/petstore:createPetWithPromise@latest",
            "name":"",
            "description":"",
            "credentials_id":"{CREDENTIAL_ID}",
            "selected_data_samples":[
              "{DATA_SAMPLE_ID}"
            ]
          }
        ],
        "edges":[
          {
            "id":"step_1:step_2",
            "source":"step_1",
            "target":"step_2"
          },
          {
            "id":"mapper:step_2:step_3",
            "config":{
              "mapper_type":"jsonata",
              "mapper":{
                "status":"\"sold\"",
                "name":"result"
              },
              "condition":null
            },
            "source":"step_2",
            "target":"step_3"
          },
          {
            "id":"mapper:step_2:step_4",
            "config":{
              "mapper_type":"jsonata",
              "mapper":{
                "status":"\"pending\"",
                "name":"result"
              },
              "condition":null
            },
            "source":"step_2",
            "target":"step_4"
          }
        ]
      },
      "nodes_config": {
        "step_1": {
          "passthrough": {
            "disabled": true
          }
        },
        "step_2": {
          "prefetch": 3,
          "disable_dynamic_flow_control": true,
          "log_level": "info"
        }
      },
      "last_modified":"2019-06-27T14:28:17.940Z",
      "name":"My flow",
      "status":"inactive",
      "type":"ordinary",
      "updated_at":"2019-06-27T14:28:17.940Z"
    },
    "relationships":{
      "user":{
        "data":{
          "id":"{USER_ID}",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/{USER_ID}"
        }
      },
      "workspace":{
        "data":{
          "id":"{WORKSPACE_ID}",
          "type":"workspace"
        },
        "links":{
          "self":"/v2/workspaces/{WORKSPACE_ID}"
        }
      },
      "versions":{
        "links":{
          "related":"/v2/flows/{FLOW_ID}/versions"
        }
      },
      "latest_version":{
        "data":{
          "id":"{FLOW_VERSION_ID}",
          "type":"flow-version"
        },
        "links":{
          "self":"/v2/flows/{FLOW_ID}/versions/{FLOW_VERSION_ID}",
          "related":"/v2/flows/{FLOW_ID}/versions/{FLOW_VERSION_ID}"
        }
      }
    }
  },
  "meta":{}

This resource allows you to create a new flow.

HTTP Request

POST https://api.connect.squiz.cloud/v2/flows/

Body Parameters

Parameter Required Description
type yes A value must be flow
attributes.name yes Flow name
attributes.type yes Flow type. May be any of: ordinary, long_running
attributes.graph yes Flow graph representing component connections
attributes.graph.nodes[].secret_id no Auth Secret ID to use for this step. It will be passed to a component action/trigger as a part of config
attributes.default_mapper_type yes The mapper type. A value must be jsonata (The handlebars is now deprecated)
attributes.nodes_config.{STEP_ID}.prefetch no This parameter configures the maximum amount of messages, that the step can process simultaneously. Must be integer
attributes.nodes_config.{STEP_ID}.replicas no This parameter configures the maximum container replicas, that can be run simultaneously. Must be integer. Default: 1. Max value: 5
attributes.nodes_config.{STEP_ID}.passthrough.disabled no This parameter toggles passthrough for a step. May be any of: true, false
attributes.nodes_config.{STEP_ID}.log_level no Log level of component running in this step. Possible values are: trace, debug, info, warn, error, fatal, default: info
attributes.nodes_config.{STEP_ID}.disable_dynamic_flow_control no This parameter configures disabling publisher confirms in sailor. Supports only for components with JVM sailor version above 3.3.5. May be any of: true, false
attributes.stats_enabled no Boolean true/false. Read more: Flow Stats Toggle
relationships.workspace.data.id yes An Id of the Workspace
relationships.workspace.data.type yes A value must be workspace

Authorization

This request is authorized for a user with the workspaces.flow.edit permission.

Returns

Returns the created flow

Update a flow

Example request

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID} \
   -X PATCH \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json' -d '
    {
          "data": {
            "type": "flow",
            "id": "{FLOW_ID}",
            "attributes": {
              "name": "this is a test task",
              "nodes_config": {
                "step_1": {
                  "passthrough": {
                    "disabled": true
                  }
                },
                "step_2": {
                  "prefetch": 3,
                  "disable_dynamic_flow_control": true,
                  "replicas": 2,
                  "log_level": "info"
                }
              }
            }
          }
    }'

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "type":"flow",
    "id":"585918da586224001b96de89",
    "links":{
      "self":"/v2/flows/585918da586224001b96de89"
    },
    "attributes":{
      "name":"this is a test task",
      "status":"inactive",
      "type":"ordinary",
      "created_at":"2018-03-27T15:39:02.825Z",
      "current_status":"inactive",
      "default_mapper_type":"jsonata",
      "description":null,
      "updated_at":"2018-03-27T15:39:02.923Z",
      "graph":{
        "nodes":[
          {
            "id":"step_1",
            "component_id": "55ba18e35d04040500000004",
            "command":"squiz-apidocs/timer:timer",
            "name":"",
            "description":"",
            "fields":{
              "interval":"minute"
            }
          },
          {
            "id":"step_2",
            "component_id": "593809a16b1d1f00196b74cd",
            "command":"squiz-apidocs/email:send",
            "name":"",
            "description":""
          }
        ],
        "edges":[
          {
            "source":"step_1",
            "target":"step_2",
            "config":{
              "mapper":{
                "to":"info@acme.org",
                "subject":"Test",
                "textBody":"FireTime"
              }
            }
          }
        ]
      },
      "nodes_config": {
        "step_1": {
          "passthrough": {
            "disabled": true
          }
        },
        "step_2": {
          "prefetch": 3,
          "disable_dynamic_flow_control": true,
          "log_level": "info"
        }
      }
    },
    "relationships":{
      "user":{
        "data":{
          "type":"user",
          "id":"560e5a27734d480a00000002"
        },
        "links":{
          "self":"/v2/users/560e5a27734d480a00000002"
        }
      },
      "workspace":{
        "data":{
          "type":"workspace",
          "id":"573dd76962436c349f000003"
        },
        "links":{
          "self":"/v2/workspaces/573dd76962436c349f000003"
        }
      },
      "versions":{
        "links":{
          "related":"/v2/flows/585918da586224001b96de89/versions"
        }
      },
      "latest_version":{
        "data":{
          "id":"787513ee82625ef46bc10372cb6485a535b54c5f",
          "type":"flow-version"
        },
        "links":{
          "self":"/v2/flows/585918da586224001b96de89/versions/787513ee82625ef46bc10372cb6485a535b54c5f",
          "related":"/v2/flows/585918da586224001b96de89/versions/787513ee82625ef46bc10372cb6485a535b54c5f"
        }
      }
    }
  },
  "meta":{}
}

This resource allows you to update the given flow. A new version of the flow will be created. The new version becomes the latest version of the flow.

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}

URL Parameters

Parameter Required Description
FLOW_ID yes Flow ID

Body Parameters

Parameter Required Description
type yes A value must be flow
id yes ID of the flow you want to update
attributes.name no Flow name
attributes.type no Flow type. May be any of: ordinary, long_running
attributes.graph no Flow graph representing component connections
attributes.graph.nodes[].secret_id no Auth Secret ID to use for this step. It will be passed to a component action/trigger as a part of config
attributes.cron no Cron expression representing flow timing
attributes.nodes_config.{STEP_ID}.prefetch no This parameter configures the maximum amount of messages, that the step can process simultaneously. Must be integer
attributes.nodes_config.{STEP_ID}.replicas no This parameter configures the maximum container replicas, that can be run simultaneously. Must be integer. Default: 1. Max value: 5
attributes.nodes_config.{STEP_ID}.passthrough.disabled no This parameter toggles passthrough for a step. May be any of: true, false
attributes.nodes_config.{STEP_ID}.log_level no Log level of component running in this step. Possible values are: trace, debug, info, warn, error, fatal, default: info
attributes.nodes_config.{STEP_ID}.disable_dynamic_flow_control no This parameter configures disabling publisher confirms in sailor. Supports only for components with JVM sailor version above 3.3.5. May be any of: true, false
attributes.stats_enabled no Boolean true/false. Read more: Flow Stats Toggle

Authorization

This request is authorized for a user with the workspaces.flow.edit permission.

Returns

Returns the updated flow

Start a flow

Example request

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/start \
   -X POST \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json'

Example response

HTTP/1.1 202 Accepted
{
  "data":{
    "type":"flow",
    "id":"585918da586224001b96de89",
    "links":{
      "self":"/v2/flows/585918da586224001b96de89"
    },
    "attributes":{
      "name":"this is a test task",
      "status":"active",
      "type":"ordinary",
      "created_at":"2018-03-27T15:39:02.825Z",
      "current_status":"inactive",
      "default_mapper_type":"jsonata",
      "description":null,
      "updated_at":"2018-03-27T15:50:00.123Z",
      "last_start_time":"2018-03-27T15:50:00.123Z",
      "due_execution":"2018-03-27T15:53:00.123Z",
      "graph":{
        "nodes":[
          {
            "id":"step_1",
            "component_id": "55ba18e35d04040500000004",
            "command":"squiz-apidocs/timer:timer",
            "name":"",
            "description":"",
            "fields":{
              "interval":"minute"
            }
          },
          {
            "id":"step_2",
            "component_id": "593809a16b1d1f00196b74cd",
            "command":"squiz-apidocs/email:send",
            "name":"",
            "description":""
          }
        ],
        "edges":[
          {
            "source":"step_1",
            "target":"step_2",
            "config":{
              "mapper":{
                "to":"info@acme.org",
                "subject":"Test",
                "textBody":"FireTime"
              }
            }
          }
        ]
      },
      "nodes_config": {
        "step_1": {
          "passthrough": {
            "disabled": true
          }
        },
        "step_2": {
          "prefetch": 3,
          "disable_dynamic_flow_control": true,
          "log_level": "info"
        }
      }
    },
    "relationships":{
      "user":{
        "data":{
          "type":"user",
          "id":"560e5a27734d480a00000002"
        },
        "links":{
          "self":"/v2/users/560e5a27734d480a00000002"
        }
      },
      "workspace":{
        "data":{
          "type":"workspace",
          "id":"573dd76962436c349f000003"
        },
        "links":{
          "self":"/v2/workspaces/573dd76962436c349f000003"
        }
      },
      "versions":{
        "links":{
          "related":"/v2/flows/585918da586224001b96de89/versions"
        }
      },
      "latest_version":{
        "data":{
          "id":"787513ee82625ef46bc10372cb6485a535b54c5f",
          "type":"flow-version"
        },
        "links":{
          "self":"/v2/flows/585918da586224001b96de89/versions/787513ee82625ef46bc10372cb6485a535b54c5f",
          "related":"/v2/flows/585918da586224001b96de89/versions/787513ee82625ef46bc10372cb6485a535b54c5f"
        }
      }
    }
  },
  "meta":{}
}

This endpoint starts a flow with given ID.

HTTP Request

POST https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/start

URL Parameters

Parameter Required Description
FLOW_ID Yes Flow identifier

Authorization

This request is authorized for a user with the workspaces.flow.toggleStatus permission.

Returns

Returns the flow

Stop a flow

Example request

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/stop \
   -X POST \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json'

Example response

HTTP/1.1 202 Accepted
{
  "data":{},
  "meta":{}
}

This endpoint stops a flow with given ID.

HTTP Request

POST https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/stop

URL Parameters

Parameter Required Description
FLOW_ID Yes Flow identifier

Authorization

This request is authorized for a user with the workspaces.flow.toggleStatus permission.

Returns

Empty response

Delete a flow

Example Request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID} \
   -X DELETE \
   -u {EMAIL}:{APIKEY}

This resource allows you to delete a flow.

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}

URL Parameters

Parameter Required Description
FLOW_ID yes Flow ID

Example Response:

HTTP/1.1 204 No Content

Copy Flow (Experimental)

Endpoint provides possibility to copy flow. Flow can be copied in two modes:

Modes are mutually exclusive (see example requests)

In both cases flow is copied into draft of new/existing flow. So to make flow to work draft should be published manually. That is done to avoid disruptions of already running flow (flow is not stopped or changed in any other way except draft), and because most likely flow copy will require additional configuration.

Flow can be copied in any workspace and contract, of course if user has enough privileges to read original flow and has enough privileges to edit flow in destination workspace.

Platform forbids to copy flow if flow components can not be used in destination context (e.g. component visibility is restricted to team, and you are copying flow in another contract)

Please note the following facts about credentials, secrets, topics and agents used in flow:

Copy into existing flow example request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/copy \
    -X POST \
    -u {EMAIL}:{APIKEY} \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' -d '
    {
        "data": {
            "type": "flow-copy",
            "attributes": {
                "dest_flow_id": "{DESTINATION_FLOW_ID}",
                "name": "{DRAFT_NAME}",
                "topic_id": "{TOPIC_ID}"
            }
        }
    }'

Copy into new flow example request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/copy \
    -X POST \
    -u {EMAIL}:{APIKEY} \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' -d '
    {
        "data": {
            "type": "flow-copy",
            "attributes": {
                "name": "{DRAFT_NAME}",
                "topic_id": "{TOPIC_ID}"
            },
            "relationships": {
                "dest_workspace": {
                    "data": {
                        "id": "{DESTINATION_WORKSPACE_ID}",
                        "type": "workspace"
                    }
                }
            }
        }
    }'

Example Response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "data":{
    "id":"{FLOW_ID}",
    "type":"flow",
    "links":{
      "self":"/v2/flows/{FLOW_ID}"
    },
    "attributes":{
      "api_version":"2.0",
      "created_at":"2019-06-27T14:28:17.918Z",
      "current_status":"inactive",
      "default_mapper_type":"jsonata",
      "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
      "graph":{
        "nodes":[],
        "edges":[]
      },
      "nodes_config": {},
      "last_modified":"2019-06-27T14:28:17.940Z",
      "name":"My flow",
      "status":"inactive",
      "type":"ordinary",
      "updated_at":"2019-06-27T14:28:17.940Z"
    },
    "relationships":{
      "user":{
        "data":{
          "id":"{USER_ID}",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/{USER_ID}"
        }
      },
      "workspace":{
        "data":{
          "id":"{WORKSPACE_ID}",
          "type":"workspace"
        },
        "links":{
          "self":"/v2/workspaces/{WORKSPACE_ID}"
        }
      },
      "versions":{
        "links":{
          "related":"/v2/flows/{FLOW_ID}/versions"
        }
      },
      "draft": {
         "data": {
           "id": "{DRAFT_ID}",
           "type": "flow-draft"
       },
        "links":{
          "self":"/v2/flows/{FLOW_ID}/versions/{FLOW_VERSION_ID}",
          "related":"/v2/flows/{FLOW_ID}/versions/{FLOW_VERSION_ID}"
        }
      }
    }
  },
  "meta":{}

HTTP Request

POST https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/copy

URL parameters

Parameter Required Description
FLOW_ID yes source flow identifier

Body Parameters

Parameter Required Description
data.type yes The value must be flow-copy
data.attributes.dest_flow_id yes Destination flow identifier (dest_workspace should not be specified)
data.relationships.dest_workspace.data.id yes Destination workspace identifier (dest_flow_id should not be specified)
data.relationships.dest_workspace.data.type yes The value must be workspace
data.attributes.topic_id no Required only if flow contains Pub-Sub components. Only one topic reference allowed
data.attributes.name no Makes possible to customize name of the draft (and flow when new flow is created)

Notices

  1. The topic (data.attributes.topic_id) must be accessible to the flow in the destination workspace, otherwise it will not be copied.
  2. It’s forbidden to use the data.attributes.topic_id parameter if flow does not contain at least one step with Pub/Sub component.
  3. It’s forbidden to use the data.attributes.topic_id parameter if your flow uses more than one Pub/Sub topic in different steps. You can copy the flow if your flow has several Pub/Sub steps that uses only one topic.
  4. In case when the data.attributes.topic_id parameter is absent from your call, topics ID will be removed from a copy if it’s not accessible and left intact if the topic is available in destination context.

Authorization

Returns

Returns created flow-draft or the draft for existing flow. If destination flow has the existing draft it will be overwritten.

Please notice once again: flow is copied as draft. So in response you may get empty flow (in copy into new flow mode) or old flow (in copy into exsising flow mode), as changes are done in draft, and draft is not included in response

Logs

Retrieve all Workspace logs

Example Request:

curl https://api.connect.squiz.cloud/v2/logs?workspace_id={WORKSPACE_ID}&from=2020-01-01T00:00:00.000Z&to=2021-12-31T23:59:59.999Z&levels[]=30 \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "total":1,
  "hits":[
    {
      "id":"4eae4f60-3c53-11ea-877e-42010a1c0003",
      "workspace_id":"5cf649c3449c1e001200c1ba",
      "flow_id":"5d3848406af31c0015c2300c",
      "user_id":"5bbf202b37f655001383e923",
      "component_id":"55bb6a58fa35a40c00000009",
      "container_id": "a6dd831f-2e1f-4a4b-818d-9cc5c156d766",
      "step_id":"step_1",
      "exec_id":"31768cc6d3c64efbaf1a703392c468c1",
      "method":"timer",
      "api_username":"task-5d3848406af31c0015c2300c",
      "component_name":"Timer",
      "timestamp":"2020-01-13T10:35:42.049Z",
      "level": 30,
      "message":"Successfully downloaded and extracted slug file"
    }
  ]
}

This endpoint allows you to retrieve all logs from specified Workspace.

HTTP Request

GET https://api.connect.squiz.cloud/v2/logs?workspace_id={WORKSPACE_ID}

URL Query Parameters

Parameter Required Description
workspace_id Yes Workspace identifier
flow_ids[] No Flow identifier
from No Start Date of the period. Format – ISO 8601. Example: 2020-01-12T14:50:42.215Z
to No End Date of the period. Format – ISO 8601. Example: 2020-01-14T15:00:45.000Z
search No String to search in logs (searching string is wrapped by tag)
offset No Number of items to skip from the beginning (defaults to 0)
limit No Number of items to return (defaults to 100)
levels[] No The logs level (1 - None, 10 - trace, 20 - debug, 30 - info, 40 - warn, 50 - error, 60 - fatal)

Authorization

This request is authorized for a user with the workspaces.logs.read_all permission.

Returns

All logs from specified Workspace.

Resources

Storage: Create a signed url

Example Request:

curl https://api.connect.squiz.cloud/v2/resources/storage/signed-url \
   -X POST  \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "put_url":"https://steward_host/files/1ksksiao",
  "get_url":"https://steward_host/files/34rwer34",
  "expires":18000
}

This endpoint creates a new signed url in Storage

HTTP Request

POST https://api.connect.squiz.cloud/v2/resources/storage/signed-url

Returns

Returns an HTTP 200 in case of successful url creation

Scheduled Executions

Preamble

What are scheduled executions?

To set up usage of some component in a certain node in certain Flow, some available configuration options could not be described in advance, because they depend on the context in each case.

Let’s consider an example when we have a component with a module, which allows retrieving a list of goods from some e-commerce platform. In this case, we have few configuration parameters, which should be configured to use a component in some flow, but all available options are different for different e-commerce installations.

The first such “dynamic” parameter is a category of a good. Each installation has its own set of goods categories.

Goods in different categories have different attributes set, so the structure of data in messages (metadata), produced by the module is dependent on selected category. So metadata also should be retrieved for each case.

And finally, each client uses own credential to connect connector with the e-commerce platform installation. Credential parameters have to be verified somehow before usage (at least to avoid confusing bugs while using component).

To solve each of three problems above, there are so-called scheduled executions, which allow running special methods of a component.These methods are:

Each of the methods is executed in the same environment as a module of a component while executing of flows.

Scheduled execution workflow

A component execution is an asynchronous operation. Upon an client request an execution is scheduled and needs to wait for the next available worker. Once a worker is available the component is executed and the results are sent back to the client. Because the results of an execution cannot be created and returned immediately the client needs to wait and poll for the results.

For more details about asynchronous REST please read RESTful CookBook and A day in the life of - Asynchronous operations in REST.

The following diagram displays the process of component scheduling:

  1. A method execution is scheduled by sending a request corresponding endpoint (see below). The API responds with 202 Accepted. The resource in the Location HTTP header is the URL to poll for execution results.
  2. The execution result is polled periodically by sending requests to the polling resourceexec/poll/{EXECUTION_ID}. The API responds with 200 OK if the result is not available yet. Please see how to poll execution results.
  3. Once the result is available the polling resource responds with 303 See Other. The resource in the Location HTTP header is the URL to get the results of the execution. Please see how to poll execution results.
  4. The results are retrieved from exec/result/{EXECUTION_ID}. Please see how to retrieve execution results.

Scheduled Executions

Verify credentials

Example Request:

 curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/verify-credential \
 -u {EMAIL}:{APIKEY} \
 -X POST -H 'Content-Type: application/json' -d '
 {
  "data":{
    "type":"verify-credential",
    "attributes":{
      "fields":{
        "apiKey":"api_secret"
      }
    },
    "relationships":{
      "workspace":{
        "data":{
          "id":"{WORKSPACE_ID}",
          "type":"workspace"
        }
      }
    }
  }
}'

Example Response:

HTTP/1.1 202 Accepted
Content-Type: application/json; charset=utf-8
Location: 'https://api.connect.squiz.cloud/v2/exec/poll/58becb8259a65f18c5c60eb0'

{
  "data":{
    "id":"5aaf90a2d0516d00077556cf",
    "type":"execution-result",
    "links":{
      "self":"/v2/exec/result/5aaf90a2d0516d00077556cf"
    },
    "attributes":{
      "result":{

      },
      "status":"Pending request, waiting other process"
    }
  },
  "meta":{}
}

This resource allows you to verify credentials. The verification credential is an asynchronous process because it is accomplished by sending a request to an external API. The entire process is described here. This page describes how to perform the 1st step of this process. Please also read details on polling execution results and retrieving execution results.

HTTP Request

POST https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/verify-credential

Authorization

This request is authorized for the users with the workspaces.credential.edit permission. The component should be accessible to the client.

URL Parameters

Parameter Required Description
COMPONENT_ID Yes Name of a component’s module.
GIT_REVISION Yes Revision of the component’s build. For available versions see here. For latest version use latest.

Body Parameters

Parameter Required Description
type Yes A value must be verify-credential.
attributes.fields Yes An object which represents the configuration of credential. The semantics are same as in creating a credential.
relationships.workspace.data.id Yes ID of the Workspace
relationships.workspace.data.type Yes Value must be workspace
relationships.vpn_agent.data.id No ID of the vpn agent
relationships.vpn_agent.data.type No In case, vpn_agent specified, this must be vpn-agent

Retrieve component’s metamodel

Example Request:

curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/dynamic-metadata \
 -u {EMAIL}:{APIKEY} \
 -X POST -H 'Content-Type: application/json' -d '
 {
  "data":{
    "type":"dynamic-metadata",
    "attributes":{
      "module":"{MODULE}",
      "fields":{
        "some_field":"value",
        "another_field":"another_value"
      }
    },
    "relationships":{
      "workspace":{
        "data":{
          "id":"{WORKSPACE_ID}",
          "type":"workspace"
        }
      },
      "credential":{
        "data":{
          "id":"{CREDENTIAL_ID}",
          "type":"credential"
        }
      }
    }
  }
}'

Example Response:

HTTP/1.1 202 Accepted
Content-Type: application/json; charset=utf-8
Location: 'https://api.connect.squiz.cloud/v2/exec/poll/58becb8359a65f18c5c60ec4'

{
  "data":{
    "id":"5aaf9d5bd0516d000775621c",
    "type":"execution-result",
    "links":{
      "self":"/v2/exec/result/5aaf9d5bd0516d000775621c"
    },
    "attributes":{
      "result":{},
      "status":"Pending request, waiting other process"
    }
  },
  "meta":{}
}

This resource allows you to retrieve component’s metamodel. The retrieval of metamodel is an asynchronous process because it is accomplished by sending a request to an external API. The entire process is described here. This page describes how to perform the 1st step of this process. Please also read details on polling execution results and retrieving execution results.

HTTP Request

POST https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/{GIT_REVISION}/dynamic-metadata

Authorization

This request is authorized for the users with the workspaces.flow.edit permission. The component should be accessible to the client.

URL Parameters

Parameter Required Description
COMPONENT_ID Yes Name of a component’s module.
GIT_REVISION Yes Revision of the component’s build. For available versions see here. For latest version use latest.

Body Parameters

Parameter Required Description
type Yes A value must be dynamic-metadata.
attributes.module Yes Name of the component’s module as defined in component.json.
attributes.fields Yes Contains values for component’s fields. Semantics are same as defining fields for a node in a flow graph.
relationships.workspace.data.id Yes ID of the Workspace
relationships.workspace.data.type Yes Value must be workspace
relationships.credential.data.id No If credentials are specified in the component’s descriptor, create a credential first and use its id.
relationships.credential.data.type No If credentials are specified in the component’s descriptor, value credential must be used here.
relationships.vpn_agent.data.id No ID of the vpn agent
relationships.vpn_agent.data.type No In case, vpn_agent specified, this must be vpn-agent

Retrieve component’s select model

Example Request:

 curl https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/{GIT_HASH}/select-model\
 -u {EMAIL}:{APIKEY} \
 -X POST -H 'Content-Type: application/json' -d '
 {
  "data":{
    "type":"select-model",
    "attributes":{
      "module":"{MODULE}",
      "method":"{METHOD}",
      "fields":{
        "some_field":"value",
        "another_field":"another_value"
      }
    },
    "relationships":{
      "workspace":{
        "data":{
          "id":"{WORKSPACE_ID}",
          "type":"workspace"
        }
      },
      "credential":{
        "data":{
          "id":"{CREDENTIAL_ID}",
          "type":"credential"
        }
      }
    }
  }
}'

Example Response:

HTTP/1.1 202 Accepted
Content-Type: application/json; charset=utf-8
Location: 'https://api.connect.squiz.cloud/v2/exec/poll/58becb8059a65f18c5c60e41'
{
  "data":{
    "id":"5aafb9e1d0516d0007757b71",
    "type":"execution-result",
    "links":{
      "self":"/v2/exec/result/5aafb9e1d0516d0007757b71"
    },
    "attributes":{
      "result":{},
      "status":"Pending request, waiting other process"
    }
  },
  "meta":{}
}

This resource allows you to retrieve component’s select model. The retrieval of select model is an asynchronous process because it is accomplished by sending a request to an external API. The entire process is described here. This page describes how to perform the 1st step of this process. Please also read details on polling execution results and retrieving execution results.

HTTP Request

POST https://api.connect.squiz.cloud/v2/components/{COMPONENT_ID}/versions/{GIT_HASH}/select-model

Authorization

This request is authorized for the users with the workspaces.flow.edit permission. The component should be accessible to the client.

URL Parameters

Parameter Required Description
COMPONENT_ID yes Name of a component’s module.
GIT_REVISION Yes Revision of the component’s build. For available versions see here. For latest version use latest.

Body Parameters

Parameter Required Description
type Yes A value must be select-model
attributes.module Yes Name of the component’s module as defined in component.json.
attributes.method Yes Name of the method, which returns select model data.
attributes.fields Yes Contains values for component’s fields. Semantics are same as defining fields for a node in a flow graph.
relationships.workspace.data.id Yes ID of the Workspace
relationships.workspace.data.type Yes Value must be workspace
relationships.credential.data.id No If credentials are specified in the component’s descriptor, create a credential first and use its id.
relationships.credential.data.type No If credentials are specified in the component’s descriptor, value credential must be used here.
relationships.vpn_agent.data.id No ID of the vpn agent
relationships.vpn_agent.data.type No In case, vpn_agent specified, this must be vpn-agent

Poll a result of an execution

Example Request:

curl https://api.connect.squiz.cloud/v2/exec/poll/{EXECUTION_ID} \
 -u {EMAIL}:{APIKEY}

Response “In progress”:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "type":"execution-result",
    "id":"58becb8059a65f18c5c60e41",
    "attributes":{
      "result":{},
      "status":"Pending request, waiting other process"
    },
    "links":{
      "self":"/v2/exec/result/58becb8059a65f18c5c60e41"
    }
  },
  "meta":{}
}

Response “Result ready”:

HTTP/1.1 303 See Other
Content-Type: application/json
Location: /v2/exec/result/58becb8059a65f18c5c60e41

{
  "data":{},
  "meta":{}
}

This resource allows you to poll a result of an execution. Once the execution is done, the endpoint responds with HTTP 303 and provides a resource for querying the result in the Location header.

HTTP Request

GET https://api.connect.squiz.cloud/v2/exec/poll/{EXECUTION_ID}

URL Parameters

Parameter Required Description
EXECUTION_ID yes Execution identifier.

Response status codes

Status Code Header Description
200 - The execution is still in progress.
303 Location The execution is finished and the result is ready. Resource to get the result is found in the Location header.
500 - Internal server error
404 - The execution does not exist (e.g. an attempt to poll for a non scheduled execution was made)

Retrieve execution result

Example Request:

curl https://api.connect.squiz.cloud/v2/exec/result/{EXECUTION_ID}  \
 -u {EMAIL}:{APIKEY}

Response

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"5aafcd56d0516d0007758cff",
    "type":"execution-result",
    "links":{
      "self":"/v2/exec/result/5aafcd56d0516d0007758cff"
    },
    "attributes":{
      "result":{
        "data":{
          "some_field_of_result":"value",
          "another_field":"another_value"
        }
      }
    }
  },
  "meta":{}
}

HTTP Request

GET https://api.connect.squiz.cloud/v2/exec/result/{EXECUTION_ID}

URL Parameters

Parameter Required Description
EXECUTION_ID yes Execution identifier.

Response status codes

Status Code Description
200 The execution result is ready.
409 The execution result is not ready yet.

Returns

This endpoint returns a result of the execution. When execution is in progress and result is not ready yet, HTTP status code 409 is returned.

Snapshots

This group of API endpoints allows you to work with snapshots feature of the Platform. The feature enables taking snapshots for all steps in a Flow. Also, it allows you to get/create/edit/remove snapshots individually for steps.

Data model: every step in Flow can have associated persistent data. Step identifier is used as identifier of snapshot. Data may be anything serializable in JSON, except undefined.

Notice: snapshot is flow’s runtime data. So it’s forbidden to edit snapshots while flow is running.

Retrieve snapshots for all steps in flow

Example Request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/snapshots \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":[
    {
      "id":"{STEP_ID}",
      "type":"snapshot",
      "links":{
        "self":"/v2/flows/{FLOW_ID}/snapshots/{STEP_ID}"
      },
      "attributes":{
        "snapshot":"{BODY OF SNAPSHOT}"
      }
    },
    {
      "id":"{STEP_ID}",
      "type":"snapshot",
      "links":{
        "self":"/v2/flows/{FLOW_ID}/snapshots/{STEP_ID}"
      },
      "attributes":{
        "snapshot":"{BODY OF SNAPSHOT}"
      }
    },
    {
      "id":"{STEP_ID}",
      "type":"snapshot",
      "links":{
        "self":"/v2/flows/{FLOW_ID}/snapshots/{STEP_ID}"
      },
      "attributes":{
        "snapshot":"{BODY OF SNAPSHOT}"
      }
    }
  ],
  "meta":{}
}

This resource allows you to retrieve snapshots for all steps in flow

HTTP Request

GET https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/snapshots

Authorization

The client has to be a member of the Workspace’s scope, where the specified Flow is located

URL Parameters

Parameter Description
FLOW_ID The ID of the Flow

Retrieve snapshot for one step in flow

Example Request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/snapshots/{STEP_ID} \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"{STEP_ID}",
    "type":"snapshot",
    "links":{
      "self":"/v2/flows/{FLOW_ID}/snapshots/{STEP_ID}"
    },
    "attributes":{
      "snapshot":"{BODY OF SNAPSHOT}"
    }
  },
  "meta":{}
}

This resource allows you to retrieve snapshot for one step in flow

HTTP Request

GET https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/snapshots/{STEP_ID}

Authorization

The client has to be a member of the Workspace’s scope, where the specified Flow is located

URL Parameters

Parameter Description
FLOW_ID The ID of the Flow
STEP_ID ID of the Step from the specified Flow

Edit snapshot for one step in flow

Example Request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/snapshots/{STEP_ID} \
   -X PATCH \
   -u {EMAIL}:{APIKEY} \
   -H 'Content-Type: application/json' -d '
   {
     "data":{
       "type":"snapshot",
       "id":"{STEP_ID}",
       "attributes":{
         "snapshot":"{BODY OF SNAPSHOT}"
       }
     }
   }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"{STEP_ID}",
    "type":"snapshot",
    "links":{
      "self":"/v2/flows/{FLOW_ID}/snapshots/{STEP_ID}"
    },
    "attributes":{
      "snapshot":"{BODY_OF_SNAPSHOT}"
    }
  },
  "meta":{}
}

This resource allows you to edit snapshot for step in flow.

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/snapshots/{STEP_ID}

Authorization

This request is authorized to a user with the workspaces.flow.edit permission.

URL Parameters

Parameter Description
FLOW_ID The ID of the Flow
STEP_ID ID of the Step from the specified Flow
Notices
  1. It’s forbidden to edit snapshot for step, that does not exist in flow.
  2. It’s forbidden to edit snapshot for step, if no snapshot exists.

Create snapshot for one step in flow

Example Request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/snapshots/ \
   -X POST \
   -u {EMAIL}:{APIKEY} \
   -H 'Content-Type: application/json' -d '
{
  "data":{
    "type":"snapshot",
    "id":"{STEP_ID}",
    "attributes":{
      "snapshot":"{BODY OF SNAPSHOT}"
    }
  }
}'

Example Response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "data":{
    "id":"{STEP_ID}",
    "type":"snapshot",
    "links":{
      "self":"/v2/flows/{FLOW_ID}/snapshots/{STEP_ID}"
    },
    "attributes":{
      "snapshot":"{BODY_OF_SNAPSHOT}"
    }
  },
  "meta":{}
}  

This resource allows you to create snapshot for step in flow.

HTTP Request

POST https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/snapshots/

Authorization

This request is authorized to a user with the workspaces.flow.edit permission.

URL Parameters

Parameter Description
FLOW_ID The ID of the Flow

Payload Parameters

Parameter Required Description
id yes ID of the Step from the specified Flow
attributes.snapshot yes The body of the snapshot. The value may be anything except undefined
Notices
  1. It’s forbidden to create snapshot for step, that does not exist in flow.
  2. It’s forbidden to create snapshot for step, if snapshot already exists.

Remove snapshot for one step in flow

Example Request:

curl https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/snapshots/{STEP_ID} \
    -X DELETE
    -u {EMAIL}:{APIKEY} \
    -H 'Accept: application/json'

Example Response:

HTTP/1.1 204 No Content
Content-Type: application/json

This resource allows you to remove a step snapshot in a Flow.

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/flows/{FLOW_ID}/snapshots/{STEP_ID}

Authorization

This request is authorized to a user with the workspaces.flow.edit permission.

URL Parameters

Parameter Description
FLOW_ID The ID of the Flow
STEP_ID ID of the Step from the specified Flow

SSH keys

Retrieve all SSH keys

Example Request:

curl https://api.connect.squiz.cloud/v2/sshkeys/ \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":[
    {
      "id":"5a4f59dbcbe7940019697ec5",
      "type":"sshkey",
      "links":{
        "self":"/v2/sshkeys/5a4f59dbcbe7940019697ec5"
      },
      "attributes":{
        "key":"ssh-key",
        "title":"test@example-UX430UQ",
        "fingerprint":"fd:d4:98:92:ed:d7:3a:0c:a2:42:ff:78:57:15:88:fa"
      },
      "relationships":{
        "user":{
          "data":{
            "id":"59d22e7eeb865b0018adc248",
            "type":"user"
          },
          "links":{
            "self":"/v2/users/59d22e7eeb865b0018adc248"
          }
        }
      }
    }
  ],
  "meta":{},
  "links":{
    "self":"/v2/sshkeys"
  }
}

This resource allows you to retrieve all SSH keys of the current user.

HTTP Request

GET https://api.connect.squiz.cloud/v2/sshkeys/

Returns

Returns an SSH key’s metadata object if the call succeeded.

Create a new SSH key

Example Request:

curl https://api.connect.squiz.cloud/v2/sshkeys/ \
    -X POST \
    -u {EMAIL}:{APIKEY} \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' -d '
    {
"data": {
        "type": "sshkey",
        "attributes": {
            "key": "ssh-rsa YOUR KEY GOES HERE",
           "title": "My New Key"
         }
    }
}'

Example Response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "data":{
    "id":"5aabedf5bd6d6400079b45f1",
    "type":"sshkey",
    "links":{
      "self":"/v2/sshkeys/5aabedf5bd6d6400079b45f1"
    },
    "attributes":{
      "key":"ssh-key",
      "title":"1603testAndDelMe",
      "fingerprint":"3a:2b:8e:7c:dc:82:3e:de:54:f4:58:8a:7d:55:fb:15"
    },
    "relationships":{
      "user":{
        "data":{
          "id":"59d22e7eeb865b0018adc248",
          "type":"user"
        },
        "links":{
          "self":"/v2/users/59d22e7eeb865b0018adc248"
        }
      }
    }
  },
  "meta":{}
}

This resource allows you to create a new SSH key.

HTTP Request

POST https://api.connect.squiz.cloud/v2/sshkeys/

Body Parameters

Parameter Required Description
type yes A value must be sshkey
attributes.key yes A valid RSA or DSA SSH public key.
attributes.title no Title of the key

Returns

Returns an SSH key’s metadata object if the call succeeded.

Delete a SSH key

Example Request:

curl https://api.connect.squiz.cloud/v2/sshkeys/{KEY_ID} \
   -X DELETE \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 204 No Content

This resource allows you to delete your own SSH key.

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/sshkeys/{KEY_ID}

URL Parameters

Parameter Required Description
KEY_ID yes SSH key ID

Stats

Retrieve the Amount of Messages in Input Queues of All Steps in the Flow

Example Request:

curl https://api.connect.squiz.cloud/v2/stats/queues/{FLOW_ID} \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
 "data": {
    "id": "{FLOW_ID}",
    "type": "flow-queue-stats",
    "attributes": {
      "stats": [
        {
          "step_id": "step_1",
          "total": 10,
          "ready": 8,
          "unacked": 2,
          "rebounds": 10
        },
        {
          "step_id": "step_2",
          "total": 20,
          "ready": 20,
          "unacked": 0,
          "rebounds": 0
        }
      ]
    }
  }
}

This endpoint allows you to retrieve the amount of messages in input queues of all steps in the flow.

HTTP Request

GET https://api.connect.squiz.cloud/v2/stats/queues/{FLOW_ID}

URL Parameters

Parameter Required Description
FLOW_ID Yes Flow ID

Authorization

This request is authorized for any member of the given Workspace.

Returns

Amount of messages in input queues of all steps in the Flow.

Retrieve the Information about Workspaces their Flows and Flow Components

Example Request:

curl https://api.connect.squiz.cloud/v2/stats/workspaces \
   -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
    {
      "id": "59d341e9037f7200184a408b",
      "type": "workspace-stats",
      "attributes": {
        "name": "Workspace 1",
        "type": "full",
        "flows": [
          {
            "id": "5ffdd11eefd48e0011ef803c",
            "name": "Flow 1",
            "status": "active",
            "type": "ordinary",
            "created_at": "2021-01-12T16:41:02.135Z",
            "updated_at": "2021-01-13T16:33:38.449Z",
            "components": [
              {
                "name": "webhook",
                "component_id": "55ba18e35d04040500000004",
                "version": "a5d0aff266698ecb61bee7e9416b2d3db4d1a20d"
              },
              {
                "name": "code",
                "component_id": "563a141fafbbef0700000003",
                "version": "latest"
              },
              {
                "name": "request-reply",
                "component_id": "5707a7f14888d9070000006a",
                "version": "f7a467a292c0996ec39423169989689de5b428a1"
              }
            ]
          }
        ]
      }
    },
    {
      "id": "5b86a38d63295500109a24b7",
      "type": "workspace-stats",
      "attributes": {
        "name": "Workspace 2",
        "type": "full",
        "flows": []
      }
    }
  ],
  "meta": {},
  "links": {
    "self": "/v2/stats/workspaces"
  }
}

This endpoint allows you to retrieve an information in form of the list of workspaces with flows in them and flow components.

HTTP Request

GET https://api.connect.squiz.cloud/v2/stats/workspaces

Query Parameters

Parameter Required Description
contract_id yes, for contract owner
prohibited, for tenant admin
Contract ID

Authorization

A client has to be a member of the Contract’s scope with the global.stats.workspaces permission or belong to the Tenant Admin users group (please contact our support department to get this specific role).

Returns

List of workspaces with related information.

Users

Retrieve Your User

Example Request:

curl https://api.connect.squiz.cloud/v2/users/me \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"59d22e7eeb865b0018adc248",
    "type":"user",
    "links":{
      "self":"/v2/users/59d22e7eeb865b0018adc248"
    },
    "attributes":{
      "first_name":"John",
      "last_name":"Doe",
      "email":"test@example.com",
      "registered":"2017-10-02T12:18:06.274Z",
      "last_login":"2018-03-15T16:53:57.696Z"
    }
  },
  "meta":{}
}

This resource allows you to retrieve your user.

HTTP Request

GET https://api.connect.squiz.cloud/v2/users/me

Returns

Returns a user object if the call succeeded.

Retrieve a User by ID

Example Request:

curl https://api.connect.squiz.cloud/v2/users/{USER_ID} \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":{
    "id":"59d3562c68ed850019bde27f",
    "type":"user",
    "links":{
      "self":"/v2/users/59d3562c68ed850019bde27f"
    },
    "attributes":{
      "first_name":"John",
      "last_name":"Doe",
      "email":"test@example.com",
      "registered":"2017-10-03T09:19:40.598Z",
      "last_login":"2018-03-16T10:30:38.656Z"
    }
  },
  "meta":{}
}

This resource allows you to retrieve a user by ID.

HTTP Request

GET https://api.connect.squiz.cloud/v2/users/{USER_ID}

URL Parameters

Parameter Required Description
USER_ID yes User identifier

Returns

Returns a user object on successful call.

Retrieve All Users

Example Request (with paging):

curl https://api.connect.squiz.cloud/v2/users/?page[size]=1&page[number]=5 \
   -g \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response (with paging):

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data":[
    {
      "id":"560e5a27734d480a00000002",
      "type":"user",
      "links":{
        "self":"/v2/users/560e5a27734d480a00000002"
      },
      "attributes":{
        "first_name":"John",
        "last_name":"Doe",
        "email":"test@example.com",
        "registered":"2015-10-02T10:19:19.697Z",
        "last_login":"2018-02-08T16:07:52.495Z"
      }
    }
  ],
  "meta":{
    "page":1,
    "per_page":1,
    "total":646,
    "total_pages":646
  }
}

Example Request (default paging):

curl https://api.connect.squiz.cloud/v2/users/ \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response (default paging):

HTTP/1.1 200 OK
Content-Type: application/json

{
  "meta":{
    "total":6,
    "page":1,
    "per_page":50,
    "total_pages":1
  },
  "data":[
    {
      "id":"588f8b04b84a6a7f3e47668d",
      "type":"user",
      "attributes":{
        "first_name":"Joannie",
        "last_name":"Smitham",
        "email":"client@my.org"
      }
    },
    {
      "id":"588f8b04b84a6a7f3e47668e",
      "type":"user",
      "attributes":{
        "first_name":"Eulalia",
        "last_name":"Hyatt",
        "email":"user-2@my.org"
      }
    },
    {
      "id":"588f8b04b84a6a7f3e47668f",
      "type":"user",
      "attributes":{
        "first_name":"Bertram",
        "last_name":"Davis",
        "email":"user-1@aliens.org"
      }
    },
    {
      "id":"588f8b04b84a6a7f3e476690",
      "type":"user",
      "attributes":{
        "first_name":"Marianne",
        "last_name":"Sawayn",
        "email":"client@outcast.org"
      }
    },
    {
      "id":"588f8b04b84a6a7f3e476691",
      "type":"user",
      "attributes":{
        "first_name":"Esta",
        "last_name":"Abbott",
        "email":"another@outcast.org"
      }
    },
    {
      "id":"588f8b04b84a6a7f3e476692",
      "type":"user",
      "attributes":{
        "first_name":"Kayleigh",
        "last_name":"Howell",
        "email":"tenant-admin@example.com"
      }
    }
  ]
}

This endpoint returns a list of users.

HTTP Request

GET https://api.connect.squiz.cloud/v2/users/

Query Parameters

Parameter Required Description Default
page[size] No Amount of items per page 50
page[number] No Number of page you want to display 1
iss No Users must have OpenId identity equal to this value. Can’t be used with “email” parameter
sub No Users must have OpenId subject equal to this value. Can’t be used with “email” parameter
email No Users must have email equal to this value

Authorization

This request is authorized for users with the tenants.user.list_all permission.

Returns

Returns a list of user objects on successful call.

Workspaces

Workspace Unit

A Workspace is a space where every user can work on an integration project independently or in collaboration with other users. Each Workspace can have more than one member. All members of a Workspace have certain roles that define user permissions. To get all available roles, please execute the “Get the Contract’s roles” endpoint. There is one predefined role - Workspace Owner. This role gives the holder all the rights within the Workspace unit, it cannot be deleted and the permissions set cannot be changed. Each role is limited to the given Workspace only. The same user in the platform can have different roles in different Workspaces.

Get Workspace by ID

Example Request:

 curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}?include=members,invites \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"59d341e9037f7200184a408b",
    "type":"workspace",
    "links":{
      "self":"/v2/workspaces/59d341e9037f7200184a408b"
    },
    "attributes":{
      "name":"My Workspace"
    },
    "relationships":{
      "contract":{
        "data":{
          "id":"5b4f337bff4304610483ba67",
          "type":"contract"
        },
        "links":{
          "self":"/v2/contracts/5b4f337bff4304610483ba67"
        }
      },
      "members":{
        "data":[
          {
            "id":"571634ecfdf77f0800000005",
            "type":"member"
          },
          {
            "id":"58c6b20124901200184fdfd1",
            "type":"member"
          }
        ],
        "links":{
          "self":"/v2/workspaces/59d341e9037f7200184a408b/members/"
        }
      },
      "invites":{
        "data":[
          {
            "id":"5b6460f73beeff001074af5b",
            "type":"workspace-invite"
          }
        ],
        "links":{
          "self":"/v2/workspaces/59d341e9037f7200184a408b/invites/"
        }
      }
    }
  },
  "meta":{},
  "included":[
    {
      "id":"560e5a27734d480a00000002",
      "type":"member",
      "links":{
        "self":"/v2/members/560e5a27734d480a00000002"
      },
      "attributes":{
        "first_name":"John",
        "last_name":"Doe",
        "roles":[
          "admin"
        ],
        "email":"john@doe.com"
      }
    },
    {
      "id":"5612c1e983dd4f0600000002",
      "type":"member",
      "links":{
        "self":"/v2/members/5612c1e983dd4f0600000002"
      },
      "attributes":{
        "first_name":"Bob",
        "last_name":"Smith",
        "roles":[
          "admin"
        ],
        "email":"bob@smith.com"
      }
    },
    {
      "id":"5b6460f73beeff001074af5b",
      "type":"workspace-invite",
      "links":{
        "self":"/v2/workspaces/59d341e9037f7200184a408b/invite/5b6460f73beeff001074af5b"
      },
      "attributes":{
        "email":"test@user.com",
        "roles":[
          "admin"
        ]
      }
    }
  ],
  "links":{
    "self":"/v2/workspaces/59d341e9037f7200184a408b"
  }
}

This endpoints returns a Workspace object for certain Workspace ID.

HTTP Request

GET https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/

Authorization

User has to be a member of the Workspace or have permision workspaces.workspace.listAll.

URL Parameters

Parameter Description
WORKSPACE_ID The ID of the Workspace

URL Query Parameters

Parameter Required Description
include no Include full resource objects in response for related entities, or not. Possible values: members and/or invites.

Get User’s Workspaces

Example Request:

 curl https://api.connect.squiz.cloud/v2/workspaces?contract_id={CONTRACT_ID} \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":[
    {
      "id":"59d341e9037f7200184a408b",
      "type":"workspace",
      "links":{
        "self":"/v2/workspaces/59d341e9037f7200184a408b"
      },
      "attributes":{
        "name":"My first Workspace"
      },
      "relationships":{
        "contract":{
          "data":{
            "id":"5b4f337bff4304610483ba67",
            "type":"contract"
          },
          "links":{
            "self":"/v2/contracts/5b4f337bff4304610483ba67"
          }
        },
        "members":{
          "data":[
            {
              "id":"571634ecfdf77f0800000005",
              "type":"member"
            },
            {
              "id":"58c6b20124901200184fdfd1",
              "type":"member"
            }
          ],
          "links":{
            "self":"/v2/workspaces/59d341e9037f7200184a408b/members/"
          }
        }
      }
    },
    {
      "id":"5b6d97bf033b500011fef487",
      "type":"workspace",
      "links":{
        "self":"/v2/workspaces/5b6d97bf033b500011fef487"
      },
      "attributes":{
        "name":"My second Workspace"
      },
      "relationships":{
        "contract":{
          "data":{
            "id":"5b4f337bff4304610483ba67",
            "type":"contract"
          },
          "links":{
            "self":"/v2/contracts/5b4f337bff4304610483ba67"
          }
        },
        "members":{
          "data":[
            {
              "id":"59d22e7eeb865b0018adc248",
              "type":"member"
            },
            {
              "id":"5b6d54a8bc7cf60010e34536",
              "type":"member"
            },
            {
              "id":"5b6da6e9bff5630010f2024f",
              "type":"member"
            }
          ],
          "links":{
            "self":"/v2/workspaces/5b6d97bf033b500011fef487/members/"
          }
        }
      }
    }
  ],
  "meta":{},
  "links":{
    "self":"/v2/workspaces"
  }
}

This endpoint returns a list of Workspaces which belong to the given User.

HTTP Request

GET https://api.connect.squiz.cloud/v2/workspaces?contract_id={CONTRACT_ID}

Query Parameters

Parameter Required Description
contract_id no Contract ID
page[size] no Amount of items per page. Default is 20.
page[number] no Number of page you want to display. Default is 1.

Authorization

User has to be a member of the Workspace.

Get a list of members of Workspace

Example Request:

 curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/members/ \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":[
    {
      "id":"59d22e7eeb865b0018adc248",
      "type":"member",
      "links":{
        "self":"/v2/members/59d22e7eeb865b0018adc248"
      },
      "attributes":{
        "first_name":"Marilyn",
        "last_name":"Manson",
        "roles":[
          "admin"
        ],
        "email":"marilyn@manson.com"
      }
    },
    {
      "id":"5b6da6e9bff5630010f2024f",
      "type":"member",
      "links":{
        "self":"/v2/members/5b6da6e9bff5630010f2024f"
      },
      "attributes":{
        "first_name":"Ozzy",
        "last_name":"Osborn",
        "roles":[
          "integrator"
        ],
        "email":"ozzy@osborn.com"
      }
    }
  ],
  "meta":{},
  "links":{
    "self":"/v2/workspaces/5b6d97bf033b500011fef487/members"
  }
}

This endpoint returns a list of all members of certain Workspace.

HTTP Request

GET https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/members/

Authorization

User has to be a member of the Workspace.

URL Parameters

Parameter Description
WORKSPACE_ID Workspace ID

Create a Workspace

Example Request:

 curl https://api.connect.squiz.cloud/v2/workspaces \
   -X POST \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json' -d '
   {
     "data":{
       "type":"workspace",
       "attributes":{
         "name":"My test Workspace from API"
       },
       "relationships":{
         "contract":{
           "data":{
             "id":"{CONTRACT_ID}",
             "type":"contract"
           }
         }
       }
     }
   }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"5b880121f3c1a800112a3bb3",
    "type":"workspace",
    "links":{
      "self":"/v2/workspaces/5b880121f3c1a800112a3bb3"
    },
    "attributes":{
      "name":"My first Workspace from API",
      "type":"full"
    },
    "relationships":{
      "contract":{
        "data":{
          "id":"5b4f337bff4304610483ba67",
          "type":"contract"
        },
        "links":{
          "self":"/v2/contracts/5b4f337bff4304610483ba67"
        }
      },
      "members":{
        "data":[
          {
            "id":"59d22e7eeb865b0018adc248",
            "type":"member"
          }
        ],
        "links":{
          "self":"/v2/workspaces/5b880121f3c1a800112a3bb3/members/"
        }
      }
    }
  },
  "meta":{}
}

This endpoint allows creating a Workspace only by the User that is a member of the Contract’s scope.

HTTP Request

POST https://api.connect.squiz.cloud/v2/workspaces

Authorization

This request is authorized for the contract’s scope members with the contracts.workspace.create permission.

Parameter Required Description
type yes Allowed value: “workspace”
attributes.name yes Name of the Workspace
attributes.flow_stats_enabled_default no Boolean true/false. Read more: Flow Stats Toggle
relationships.contract.data.id yes An Id of the contract
relationships.contract.data.type yes A value must be “contract”

Returns

Returns Workspace object on successful call.

Update a Workspace

Example Request:

 curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID} \
   -X PATCH \
   -u {EMAIL}:{APIKEY} \
   -H 'Accept: application/json' \
   -H 'Content-Type: application/json' -d '
    {
   "data":{
     "type":"workspace",
     "attributes":{
       "name":"New Workspace Name",
       "type":"limited"
       }
     }
   }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"{WORKSPACE_ID}",
    "type":"workspace",
    "links":{
      "self":"/v2/workspaces/{WORKSPACE_ID}"
    },
    "attributes":{
      "name":"New Workspace Name",
      "type":"full"
    },
    "relationships":{
      "contract":{
        "data":{
          "id":"{CONTRACT_ID}",
          "type":"contract"
        },
        "links":{
          "self":"/v2/contracts/{CONTRACT_ID}"
        }
      },
      "members":{
        "data":[
          {
            "id":"{USER_ID}",
            "type":"member"
          }
        ],
        "links":{
          "self":"/v2/workspaces/{WORKSPACE_ID}/members/"
        }
      }
    }
  },
  "meta":{}
}

This endpoint allows to update Workspace name.

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}

Authorization

The request to update the name of Workspace is authorized for the contract’s scope members with the workspaces.workspace.edit permission.

To update the type of Workspace this request is authorized for users with the workspaces.workspace.edit_type permission.

Parameter Required Description
type yes Allowed value: “workspace”
attributes.name yes Name of the Workspace
attributes.flow_stats_enabled_default no Boolean true/false. Read more: Flow Stats Toggle
attributes.type no Type of the Workspace. Allowed values: full or limited.

Returns

Returns Workspace object if the call succeeded

Update membership in Workspace

Example Request:

curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/members/{USER_ID}/ \
    -X PATCH  \
    -u {EMAIL}:{APIKEY} \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' -d '
    {
       "data": {
           "type": "member",
           "id": "{USER_ID}",
           "attributes": {
               "roles": [
                 "{NEW_ROLE}"
               ]
           }
       }
    }'

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"59f747c33f1d3c001901a44e",
    "type":"member",
    "links":{
      "self":"/v2/members/59f747c33f1d3c001901a44e"
    },
    "attributes":{
      "roles": [
        "{NEW_ROLE}"
      ]
    }
  },
  "meta":{}
}

This endpoint allows updating a membership of a given User. Only roles attribute can be updated.

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/members/{USER_ID}/

Authorization

This request is authorized for a User with workspaces.workspace.edit or tenant.workspace.edit_membership permissions only.

URL Parameters

Parameter Description
WORKSPACE_ID The ID of the Workspace
USER_ID The ID of the User to be updated

Payload Parameters

Parameter Required Description
type yes Allowed value: “member”.
id yes ID of an already registered User, must match URL param {USER_ID}
attributes.roles[] yes To get all available roles, please execute the “Get the Contract’s roles” endpoint.

Returns

Returns member object if the call succeeded

Remove member from Workspace

Example Request:

 curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/members/{USER_ID}/ \
    -X DELETE    \
    -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 204 No Content

Remove a membership of the User in the Workspace. Ownership of those user’s associated data will be transferred to the User performing this operation:

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/members/{USER_ID}/

Authorization

This request is authorized for a User with workspaces.workspace.edit or tenant.workspace.edit_membership permissions only.

URL Parameters

Parameter Description
WORKSPACE_ID Workspace ID
USER_ID The ID of the user, which should leave the Workspace

Returns

Responds with 204 No content if the call succeeded (with empty body).

Grant support access to the Workspace

Example Request:

curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/members/support \
    -X PATCH  \
    -u {EMAIL}:{APIKEY} \
    -H 'Accept: application/json' \

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
  "data":{
    "id":"59f747c33f1d3c001901a44e",
    "type":"member",
    "links":{
      "self":"/v2/members/59f747c33f1d3c001901a44e"
    },
    "attributes":{
      "roles": [
        "owner"
      ]
    }
  },
  "meta":{}
}

This endpoint allows to add platform support User into Workspase with owner role. The attribute support_user_id should be defined for Contract or Tenant. If support user is not a member of corresponding Contract he/she will be added to this Contract with owner role as well.

HTTP Request

PATCH https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/members/support

Authorization

This request is authorized for a User with workspace.workspace.edit_membership_support permission only.

URL Parameters

Parameter Description
WORKSPACE_ID The ID of the Workspace

Returns

Returns the support member object if call succeed.

Remove support user from the Workspace

Example Request:

curl https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/members/support \
    -X DELETE  \
    -u {EMAIL}:{APIKEY} \
    -H 'Accept: application/json' \

Example Response:

HTTP/1.1 204 No Content

This endpoint allows to remove platform support User from Workspace. If support user is not a member of any other Workspace of corresponding Contract he/she will be removed from this Contract as well.

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID}/members/support

Authorization

This request is authorized for a User with workspace.workspace.edit_membership_support permission only.

URL Parameters

Parameter Description
WORKSPACE_ID The ID of the Workspace

Returns

Returns empty body if call succeed.

Delete Workspace

Example Request:

 curl -i https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID} \
  -X DELETE \
  -u {EMAIL}:{APIKEY}

Example Response:

HTTP/1.1 204 No Content

This endpoint will delete the Workspace along with the following items that were inside the Workspace:

*Note, that the deletion process is asynchronous. Actual deletion of all data will be performed after API response, because it will take some time to terminate all containers of Workspace’s flows. *

HTTP Request

DELETE https://api.connect.squiz.cloud/v2/workspaces/{WORKSPACE_ID} \

Authorization

This request can be performed by either the Contract’s user (the current Workspace assigned to) with the contracts.workspace.delete permission or just the Workspace’s user with the workspaces.workspace.edit permission.

URL Parameters

Parameter Description
{WORKSPACE_ID} The ID of the Workspace

Returns

Responds with 204 No content if the call succeeded (with empty body).