Oneflow Integration Platform

Use the Oneflow API to build powerful integrations to automate your contract management.

Endpoints

Public API for Oneflow

This section describes all Oneflow public APIs and their methods used for creating and interacting with Oneflow contracts. All references are grouped into several main categories according to their function:

CategoryDescription
CoreCore endpoints
ContractContract endpoints
TemplatesTemplates endpoints
HelpersHelpers endpoints
Template typesTemplate types endpoints
EventsEvents endpoints
AttachmentAttachment endpoints
WorkspaceWorkspace endpoints

Use the following base URL while working with APIs: https://api.oneflow.com/v1
Please, read more information about our environments in the Authentication and authorization section.

Postman collection

If you'd like to create a Postman collection from our API for testing and development,
you can download the file here:
Oneflow_API_version_1.yml.
Please reference the Postman documentation for how to create a Postman collection from an OpenAPI specification.

Core

Check API availability

/ping

Use this endpoint to check if the Oneflow API is available and to authenticate a Oneflow user.

GET /ping


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/ping \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/ping"

headers = {
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response codes

StatusMeaningDescription
200OKThe service is up, and the API token is valid.
401UnauthorizedThe API token or the user email is invalid.

Contract

Get contracts

/contracts

Use this endpoint to retrieve the list of contracts available for the specified account.

GET /contracts


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Query parameters

NameTypeRequiredDescription
offsetintegerfalseminimum: 0, maximum: 19900
limitintegerfalseminimum: 1, maximum: 100
sortstringfalseThe list of columns separated by ',' to sort the results.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/contracts \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/contracts"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample list of contracts from an account:

{
  "_links": {
    "next": {
      "href": "https://api.oneflow.com/v1/contracts?offset=1&limit=1"
    },
    "previous": {
      "href": null
    },
    "self": {
      "href": "https://api.oneflow.com/v1/contracts?offset=0&limit=1"
    }
  },
  "count": 2,
  "data": [
    {
      "_links": {
        "data_fields": {
          "href": "https://api.oneflow.com/v1/contracts/51874/data_fields"
        },
        "events": {
          "href": "https://api.oneflow.com/v1/contracts/51874/events"
        },
        "files": {
          "href": "https://api.oneflow.com/v1/contracts/51874/files"
        },
        "parties": {
          "href": "https://api.oneflow.com/v1/contracts/51874/parties"
        },
        "publish": {
          "href": "https://api.oneflow.com/v1/contracts/51874/publish"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/51874"
        },
        "template": {
          "href": "https://api.oneflow.com/v1/templates/11111"
        },
        "template_type": {
          "href": "https://api.oneflow.com/v1/template_types/12222"
        },
        "workspace": {
          "href": "https://api.oneflow.com/v1/workspaces/12345"
        }
      },
      "_permissions": {
        "contract:delete": true
      },
      "_private": {
        "name": "My First Contract",
        "value": {
          "amount": "500.10",
          "currency": "SEK"
        },
        "workspace_id": 12345
      },
      "_private_ownerside": {
        "created_time": "2020-06-30T07:15:23+00:00",
        "template_id": 11111,
        "template_type_id": 12222
      },
      "id": 51874,
      "lifecycle_settings": {
        "duration": "12m",
        "end_date": null,
        "initial_duration": null,
        "notice_period": "3m",
        "start_date": "2020-07-09",
        "type": "recurring"
      },
      "lifecycle_state": {
        "contract_end_time": null,
        "contract_start_time": "2020-07-09T00:00:00+00:00",
        "cancel_time": null,
        "has_ended_by_termination": false,
        "has_passed_notice_period_start_time": true,
        "is_canceled": false,
        "is_recurring": true,
        "lifecycle_state": "active",
        "lifecycle_state_updated_time": "2020-07-09T12:54:53+00:00",
        "notice_period_start_time": "2021-04-09T00:00:00+00:00",
        "period": 1,
        "period_end_time": "2021-07-09T00:00:00+00:00",
        "period_start_time": "2020-07-09T00:00:00+00:00"
      },
      "parties": [
        {
          "_private_ownerside": {
            "created_time": "2020-06-30T07:15:23+00:00",
            "updated_time": null
          },
          "country_code": "SE",
          "id": 353218,
          "identification_number": "11223344-5566",
          "my_party": true,
          "name": "My Company AB",
          "participants": [
            {
              "_permissions": {
                "contract:update": true
              },
              "_private_ownerside": {
                "created_time": "2020-06-30T07:15:23+00:00",
                "first_visited_time": "2020-06-30T07:15:23+00:00",
                "last_visited_time": "2020-08-04T10:14:30+00:00",
                "updated_time": "2020-08-04T10:14:30+00:00",
                "visits": 5
              },
              "delivery_channel": "email",
              "delivery_status": "success",
              "email": "[email protected]",
              "id": 113703,
              "identification_number": "",
              "my_participant": false,
              "name": "First Last",
              "organizer": false,
              "phone_number": "",
              "sign_method": "standard_esign",
              "sign_state": "signed",
              "sign_state_updated_time": "2020-07-09T12:53:54+00:00",
              "signatory": true,
              "title": "",
              "two_step_authentication_method": "none"
            }
          ],
          "type": "company"
        },
        {
          "_private_ownerside": {
            "created_time": "2020-06-30T07:17:17+00:00",
            "updated_time": null
          },
          "country_code": "SE",
          "id": 353219,
          "identification_number": "111111",
          "my_party": false,
          "name": "Endpoint Test",
          "participants": [
            {
              "_permissions": {
                "contract:update": true
              },
              "_private_ownerside": {
                "created_time": "2020-06-30T07:17:17+00:00",
                "first_visited_time": "2020-07-09T12:54:42+00:00",
                "last_visited_time": "2020-07-09T12:54:55+00:00",
                "updated_time": "2020-07-09T12:55:00+00:00",
                "visits": 3
              },
              "delivery_channel": "email",
              "delivery_status": "success",
              "email": "[email protected]",
              "id": 113704,
              "identification_number": "",
              "my_participant": false,
              "name": "Endpoint Test",
              "organizer": false,
              "phone_number": "+111222333444",
              "sign_method": "standard_esign",
              "sign_state": "signed",
              "sign_state_updated_time": "2020-07-09T12:54:53+00:00",
              "signatory": true,
              "title": "",
              "two_step_authentication_method": "email"
            }
          ],
          "type": "company"
        }
      ],
      "published_time": "2020-06-30T07:38:55+00:00",
      "signing_period_expiry_time": "2020-07-15T00:00:00+00:00",
      "state": "signed",
      "state_updated_time": "2020-07-09T12:54:53+00:00",
      "updated_time": "2020-07-09T12:54:57+00:00"
    },
    {
      "_links": {
        "data_fields": {
          "href": "https://api.oneflow.com/v1/contracts/51910/data_fields"
        },
        "events": {
          "href": "https://api.oneflow.com/v1/contracts/51910/events"
        },
        "files": {
          "href": "https://api.oneflow.com/v1/contracts/51910/files"
        },
        "parties": {
          "href": "https://api.oneflow.com/v1/contracts/51910/parties"
        },
        "publish": {
          "href": "https://api.oneflow.com/v1/contracts/51910/publish"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/51910"
        },
        "template": {
          "href": "https://api.oneflow.com/v1/templates/11111"
        },
        "template_type": {
          "href": "None"
        },
        "workspace": {
          "href": "https://api.oneflow.com/v1/workspaces/12345"
        }
      },
      "_permissions": {
        "contract:delete": true
      },
      "_private": {
        "name": "My Second Contract",
        "value": {
          "amount": "420.00",
          "currency": "SEK"
        },
        "workspace_id": 12345
      },
      "_private_ownerside": {
        "created_time": "2020-06-30T07:15:23+00:00",
        "template_id": 11111,
        "template_type_id": "None"
      },
      "id": 51910,
      "lifecycle_settings": {
        "duration": "12m",
        "end_date": null,
        "initial_duration": null,
        "notice_period": "3m",
        "start_date": "2020-07-09",
        "type": "recurring"
      },
      "lifecycle_state": {
        "contract_end_time": null,
        "contract_start_time": "2020-07-09T00:00:00+00:00",
        "cancel_time": null,
        "has_ended_by_termination": false,
        "has_passed_notice_period_start_time": true,
        "is_canceled": false,
        "is_recurring": true,
        "lifecycle_state": "active",
        "lifecycle_state_updated_time": "2020-07-09T12:54:53+00:00",
        "notice_period_start_time": "2021-04-09T00:00:00+00:00",
        "period": 1,
        "period_end_time": "2021-07-09T00:00:00+00:00",
        "period_start_time": "2020-07-09T00:00:00+00:00"
      },
      "parties": [
        {
          "_private_ownerside": {
            "created_time": "2020-06-30T07:15:23+00:00",
            "updated_time": null
          },
          "country_code": "SE",
          "id": 453218,
          "identification_number": "11223344-5566",
          "my_party": true,
          "name": "My Company AB",
          "participants": [
            {
              "_permissions": {
                "contract:update": true
              },
              "_private_ownerside": {
                "created_time": "2020-06-30T07:15:23+00:00",
                "first_visited_time": "2020-06-30T07:15:23+00:00",
                "last_visited_time": "2020-08-04T10:14:30+00:00",
                "updated_time": "2020-08-04T10:14:30+00:00",
                "visits": 5
              },
              "delivery_channel": "email",
              "delivery_status": "success",
              "email": "[email protected]",
              "id": 213703,
              "identification_number": "",
              "my_participant": false,
              "name": "First Last",
              "organizer": true,
              "phone_number": "",
              "sign_method": "standard_esign",
              "sign_state": "signed",
              "sign_state_updated_time": "2020-07-09T12:53:54+00:00",
              "signatory": false,
              "title": "",
              "two_step_authentication_method": "none"
            }
          ],
          "type": "company"
        },
        {
          "_private_ownerside": {
            "created_time": "2020-06-30T07:17:17+00:00",
            "updated_time": null
          },
          "country_code": "SE",
          "id": 453219,
          "identification_number": "111111",
          "my_party": false,
          "name": "Endpoint Test",
          "participants": [
            {
              "_permissions": {
                "contract:update": true
              },
              "_private_ownerside": {
                "created_time": "2020-06-30T07:17:17+00:00",
                "first_visited_time": "2020-07-09T12:54:42+00:00",
                "last_visited_time": "2020-07-09T12:54:55+00:00",
                "updated_time": "2020-07-09T12:55:00+00:00",
                "visits": 3
              },
              "delivery_channel": "email",
              "delivery_status": "success",
              "email": "[email protected]",
              "id": 213704,
              "identification_number": "",
              "my_participant": false,
              "name": "Endpoint Test",
              "organizer": false,
              "phone_number": "+111222333444",
              "sign_method": "standard_esign",
              "sign_state": "signed",
              "sign_state_updated_time": "2020-07-09T12:54:53+00:00",
              "signatory": true,
              "title": "",
              "two_step_authentication_method": "email"
            }
          ],
          "type": "company"
        }
      ],
      "published_time": "2020-06-30T07:38:55+00:00",
      "signing_period_expiry_time": "2020-07-15T00:00:00+00:00",
      "state": "signed",
      "state_updated_time": "2020-07-09T12:54:53+00:00",
      "updated_time": "2020-07-09T12:54:57+00:00"
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns the list of all contracts in the specified account.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.

Get a contract by ID

/contracts/{contract_id}

Use this endpoint to retrieve a specific contract by its ID.

GET /contracts/{contract_id}


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/contracts/10015 \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/contracts/10015"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample contract with parties and products:

{
  "_links": {
    "data_fields": {
      "href": "https://api.oneflow.com/v1/contracts/10015/data_fields"
    },
    "events": {
      "href": "https://api.oneflow.com/v1/contracts/10015/events"
    },
    "files": {
      "href": "https://api.oneflow.com/v1/contracts/10015/files"
    },
    "parties": {
      "href": "https://api.oneflow.com/v1/contracts/10015/parties"
    },
    "publish": {
      "href": "https://api.oneflow.com/v1/contracts/10015/publish"
    },
    "self": {
      "href": "https://api.oneflow.com/v1/contracts/10015"
    },
    "template": {
      "href": "https://api.oneflow.com/v1/templates/11111"
    },
    "template_type": {
      "href": "https://api.oneflow.com/v1/template_types/12222"
    },
    "workspace": {
      "href": "https://api.oneflow.com/v1/workspaces/12345"
    }
  },
  "_permissions": {
    "contract:delete": true
  },
  "_private": {
    "name": "My First Contract",
    "value": {
      "amount": "500.10",
      "currency": "SEK"
    },
    "workspace_id": 12345
  },
  "_private_ownerside": {
    "created_time": "2020-06-30T07:15:23+00:00",
    "template_id": 11111,
    "template_type_id": 12222
  },
  "available_options": {
    "can_receive_attachments": false,
    "can_receive_expanded_pdf": false,
    "can_receive_products": false,
    "delivery_channels": [
      {
        "name": "email",
        "preferred": false,
        "required_participant_attributes": [
          "email"
        ]
      },
      {
        "name": "none",
        "preferred": false,
        "required_participant_attributes": []
      },
      {
        "name": "same_device",
        "preferred": true,
        "required_participant_attributes": []
      }
    ],
    "sign_methods": [
      {
        "name": "norwegian_bankid",
        "preferred": false
      },
      {
        "name": "standard_esign",
        "preferred": false
      },
      {
        "name": "swedish_bankid",
        "preferred": true
      }
    ],
    "two_step_authentication_methods": [
      {
        "name": "email",
        "preferred": true,
        "required_participant_attributes": [
          "email"
        ]
      },
      {
        "name": "none",
        "preferred": false,
        "required_participant_attributes": []
      }
    ]
  },
  "data_fields": [
    {
      "_private_ownerside": {
        "created_time": "2021-06-03T15:00:00+00:00",
        "custom_id": "firstname",
        "updated_time": null
      },
      "description": "firstname of the user",
      "id": 1,
      "name": "firstname",
      "placeholder": "firstname placeholder",
      "value": "Foo"
    },
    {
      "_private_ownerside": {
        "created_time": "2021-06-03T15:00:00+00:00",
        "custom_id": "lastname",
        "updated_time": null
      },
      "description": "lastname of the user",
      "id": 2,
      "name": "lastname",
      "placeholder": "lastname placeholder",
      "value": "Bar"
    }
  ],
  "id": 10015,
  "lifecycle_settings": {
    "duration": "12m",
    "end_date": null,
    "initial_duration": null,
    "notice_period": "3m",
    "start_date": "2020-07-09",
    "type": "recurring"
  },
  "lifecycle_state": {
    "contract_end_time": null,
    "contract_start_time": "2020-07-09T00:00:00+00:00",
    "cancel_time": null,
    "has_ended_by_termination": false,
    "has_passed_notice_period_start_time": true,
    "is_canceled": false,
    "is_recurring": true,
    "lifecycle_state": "active",
    "lifecycle_state_updated_time": "2020-07-09T12:54:53+00:00",
    "notice_period_start_time": "2021-04-09T00:00:00+00:00",
    "period": 1,
    "period_end_time": "2021-07-09T00:00:00+00:00",
    "period_start_time": "2020-07-09T00:00:00+00:00"
  },
  "parties": [
    {
      "_private_ownerside": {
        "created_time": "2020-06-30T07:15:23+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 353218,
      "identification_number": "11223344-5566",
      "my_party": true,
      "name": "Own Company AB",
      "participants": [
        {
          "_permissions": {
            "contract:update": true
          },
          "_private_ownerside": {
            "created_time": "2020-06-30T07:15:23+00:00",
            "first_visited_time": "2020-06-30T07:15:23+00:00",
            "last_visited_time": "2020-08-04T10:14:30+00:00",
            "updated_time": "2020-08-04T10:14:30+00:00",
            "visits": 5
          },
          "delivery_channel": "email",
          "delivery_status": "success",
          "email": "[email protected]",
          "id": 113703,
          "identification_number": "",
          "my_participant": false,
          "name": "First Last",
          "organizer": false,
          "phone_number": "",
          "sign_method": "standard_esign",
          "sign_state": "signed",
          "sign_state_updated_time": "2020-07-09T12:53:54+00:00",
          "signatory": true,
          "title": "Sales Manager",
          "two_step_authentication_method": "none"
        }
      ],
      "type": "company"
    },
    {
      "_private_ownerside": {
        "created_time": "2020-06-30T07:17:17+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 353219,
      "identification_number": "111111",
      "my_party": false,
      "name": "Company AB",
      "participants": [
        {
          "_permissions": {
            "contract:update": true
          },
          "_private_ownerside": {
            "created_time": "2020-06-30T07:17:17+00:00",
            "first_visited_time": "2020-07-09T12:54:42+00:00",
            "last_visited_time": "2020-07-09T12:54:55+00:00",
            "updated_time": "2020-07-09T12:55:00+00:00",
            "visits": 3
          },
          "delivery_channel": "email",
          "delivery_status": "success",
          "email": "[email protected]",
          "id": 113704,
          "identification_number": "",
          "my_participant": false,
          "name": "Endpoint Test",
          "organizer": false,
          "phone_number": "+111222333444",
          "sign_method": "standard_esign",
          "sign_state": "signed",
          "sign_state_updated_time": "2020-07-09T12:54:53+00:00",
          "signatory": true,
          "title": "",
          "two_step_authentication_method": "email"
        }
      ],
      "type": "company"
    },
    {
      "_private_ownerside": {
        "created_time": "2020-07-04T11:59:13+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 350398,
      "identification_number": "10034544-0066",
      "my_party": false,
      "name": "First Last",
      "participant": {
        "_permissions": {
          "contract:update": true
        },
        "_private_ownerside": {
          "created_time": "2020-07-04T11:59:13+00:00",
          "first_visited_time": null,
          "last_visited_time": null,
          "updated_time": "2020-07-04T11:59:13+00:00",
          "visits": 0
        },
        "delivery_channel": "email",
        "delivery_status": "success",
        "email": "[email protected]",
        "id": 170397,
        "identification_number": "10034544-0066",
        "my_participant": false,
        "name": "First Last",
        "organizer": false,
        "phone_number": "+111222333666",
        "sign_method": "standard_esign",
        "sign_state": "undecided",
        "sign_state_updated_time": null,
        "signatory": true,
        "title": "",
        "two_step_authentication_method": "email"
      },
      "type": "individual"
    }
  ],
  "product_groups": [
    {
      "_private_ownerside": {
        "created_time": "2021-01-29T08:55:46+00:00",
        "updated_time": "2021-01-29T08:55:46+00:00"
      },
      "id": 75861,
      "products": [
        {
          "_private_ownerside": {
            "created_time": "2021-01-29T08:55:46+00:00",
            "updated_time": "2021-01-29T08:55:46+00:00"
          },
          "counterparty_lock": false,
          "description": "shiny shoes for sunny saunters",
          "id": 135805,
          "name": "shoes",
          "price_1": {
            "amount": {
              "amount": "90.00"
            },
            "base_amount": {
              "amount": "100.00"
            },
            "discount_amount": {
              "amount": "0.00"
            },
            "discount_percent": "10.000"
          },
          "price_2": {
            "amount": {
              "amount": "0.00"
            },
            "base_amount": {
              "amount": "0.00"
            },
            "discount_amount": {
              "amount": "0.00"
            },
            "discount_percent": "0.000"
          },
          "quantity": {
            "amount": 1,
            "type": "multiple_choice"
          }
        }
      ]
    }
  ],
  "published_time": null,
  "signing_period_expiry_time": "2020-07-15T00:00:00+00:00",
  "state": "draft",
  "state_updated_time": "2020-07-09T12:54:53+00:00",
  "updated_time": "2020-07-09T12:54:57+00:00"
}

Response codes

StatusMeaningDescription
200OKReturns the requested contract.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Delete a contract by ID

/contracts/{contract_id}

Use this endpoint to delete a specific contract by its ID.

DELETE /contracts/{contract_id}


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.

Code example

curl --request DELETE \
  --url https://api.oneflow.com/v1/contracts/10015 \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/contracts/10015"

headers = {
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("DELETE", url, headers=headers)

print(response.text)

Response codes

StatusMeaningDescription
200OKThe contract was deleted successfully. This response is also returned if the contract does not exist.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.

Get contract parties

/contracts/{contract_id}/parties

Use this endpoint to retrieve the list of parties for the specified contract ID.

GET /contracts/{contract_id}/parties


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/contracts/10015/parties \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/parties"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response with a list of parties in a contract:

{
  "count": 3,
  "data": [
    {
      "_links": null,
      "contract": {
        "href": "https://api.flowdev.com/v1/contracts/10015"
      },
      "self": {
        "href": "https://api.flowdev.com/v1/contracts/10015/parties/353218"
      },
      "_private_ownerside": {
        "created_time": "2020-06-30T07:15:23+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 353218,
      "identification_number": "11223344-5566",
      "my_party": true,
      "name": "Own Company AB",
      "participants": [
        {
          "_permissions": {
            "contract:update": true
          },
          "_private_ownerside": {
            "created_time": "2020-06-30T07:15:23+00:00",
            "first_visited_time": "2020-06-30T07:15:23+00:00",
            "last_visited_time": "2020-08-04T10:14:30+00:00",
            "updated_time": "2020-08-04T10:14:30+00:00",
            "visits": 5
          },
          "delivery_channel": "email",
          "delivery_status": "success",
          "email": "[email protected]",
          "id": 113703,
          "identification_number": "",
          "my_participant": false,
          "name": "First Last",
          "organizer": false,
          "phone_number": "",
          "sign_method": "standard_esign",
          "sign_state": "signed",
          "sign_state_updated_time": "2020-07-09T12:53:54+00:00",
          "signatory": true,
          "title": "Sales Manager",
          "two_step_authentication_method": "none"
        }
      ],
      "type": "company"
    },
    {
      "_links": {
        "contract": {
          "href": "https://api.flowdev.com/v1/contracts/10015"
        },
        "self": {
          "href": "https://api.flowdev.com/v1/contracts/10015/parties/353218"
        }
      },
      "_private_ownerside": {
        "created_time": "2020-06-30T07:17:17+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 353219,
      "identification_number": "111111",
      "my_party": false,
      "name": "Company AB",
      "participants": [
        {
          "_permissions": {
            "contract:update": true
          },
          "_private_ownerside": {
            "created_time": "2020-06-30T07:17:17+00:00",
            "first_visited_time": "2020-07-09T12:54:42+00:00",
            "last_visited_time": "2020-07-09T12:54:55+00:00",
            "updated_time": "2020-07-09T12:55:00+00:00",
            "visits": 3
          },
          "delivery_channel": "email",
          "delivery_status": "success",
          "email": "[email protected]",
          "id": 113704,
          "identification_number": "",
          "my_participant": false,
          "name": "Endpoint Test",
          "organizer": false,
          "phone_number": "+111222333444",
          "sign_method": "standard_esign",
          "sign_state": "signed",
          "sign_state_updated_time": "2020-07-09T12:54:53+00:00",
          "signatory": true,
          "title": "",
          "two_step_authentication_method": "email"
        }
      ],
      "type": "company"
    },
    {
      "_private_ownerside": {
        "created_time": "2020-07-04T11:59:13+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 350398,
      "identification_number": "10034544-0066",
      "my_party": false,
      "name": "First Last",
      "participant": {
        "_permissions": {
          "contract:update": true
        },
        "_private_ownerside": {
          "created_time": "2020-07-04T11:59:13+00:00",
          "first_visited_time": null,
          "last_visited_time": null,
          "updated_time": "2020-07-04T11:59:13+00:00",
          "visits": 0
        },
        "delivery_channel": "email",
        "delivery_status": "success",
        "email": "[email protected]",
        "id": 170397,
        "identification_number": "10034544-0066",
        "my_participant": false,
        "name": "First Last",
        "organizer": false,
        "phone_number": "+111222333666",
        "sign_method": "standard_esign",
        "sign_state": "undecided",
        "sign_state_updated_time": null,
        "signatory": true,
        "title": "",
        "two_step_authentication_method": "email"
      },
      "type": "individual"
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns the list of parties in a contract.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Get a party from a contract

/contracts/{contract_id}/parties/{party_id}

Use this endpoint to retrieve a party from a contract.

GET /contracts/{contract_id}/parties/{party_id}


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.
party_idinteger(signed_integer_id)The ID of a party in a contract.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/contracts/10015/parties/353218 \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/parties/353218"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response with a party from a contract:

{
  "_links": {
    "contract": {
      "href": "https://api.flowdev.com/v1/contracts/10015"
    },
    "self": {
      "href": "https://api.flowdev.com/v1/contracts/10015/parties/353218"
    }
  },
  "_private_ownerside": {
    "created_time": "2020-06-30T07:15:23+00:00",
    "updated_time": null
  },
  "country_code": "SE",
  "id": 353218,
  "identification_number": "11223344-5566",
  "my_party": true,
  "name": "Own Company AB",
  "participants": [
    {
      "_permissions": {
        "contract:update": true
      },
      "_private_ownerside": {
        "created_time": "2020-06-30T07:15:23+00:00",
        "first_visited_time": "2020-06-30T07:15:23+00:00",
        "last_visited_time": "2020-08-04T10:14:30+00:00",
        "updated_time": "2020-08-04T10:14:30+00:00",
        "visits": 5
      },
      "delivery_channel": "email",
      "delivery_status": "success",
      "email": "[email protected]",
      "id": 113703,
      "identification_number": "",
      "my_participant": false,
      "name": "First Last",
      "organizer": false,
      "phone_number": "",
      "sign_method": "standard_esign",
      "sign_state": "signed",
      "sign_state_updated_time": "2020-07-09T12:53:54+00:00",
      "signatory": true,
      "title": "Sales Manager",
      "two_step_authentication_method": "none"
    }
  ],
  "type": "company"
}

Response codes

StatusMeaningDescription
200OKReturns the requested party.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Delete a contract party by ID

/contracts/{contract_id}/parties/{party_id}

Use this endpoint to delete a specific contract party by its ID.

DELETE /contracts/{contract_id}/parties/{party_id}


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.
party_idinteger(signed_integer_id)The ID of a party in a contract.

Code example

curl --request DELETE \
  --url https://api.oneflow.com/v1/contracts/10015/parties/353218 \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/parties/353218"

headers = {
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("DELETE", url, headers=headers)

print(response.text)

Response codes

StatusMeaningDescription
200OKThe contract party was deleted successfully.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
403ForbiddenThe request is not authorized by the server.
404Not FoundA required entity is missing.
409ConflictA conflict occurred with the current state of the target resource.

Get contract data fields

/contracts/{contract_id}/data_fields

Use this endpoint to retrieve the list of data fields for the specified contract ID.

GET /contracts/{contract_id}/data_fields


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.

Query parameters

NameTypeRequiredDescription
offsetintegerfalseminimum: 0, maximum: 19900
limitstring(limit)falseThe resource limit (minimum 1, maximum 100). Set limit = all to get all resources at once.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/contracts/10015/data_fields \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/data_fields"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response with a list of data fields:

{
  "count": 2,
  "data": [
    {
      "_links": {
        "contract": {
          "href": "https://api.oneflow.com/v1/contracts/10015"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/10015/data_fields/1"
        }
      },
      "_private_ownerside": {
        "created_time": "2021-06-03T15:00:00+00:00",
        "custom_id": "firstname",
        "updated_time": null,
        "description": "firstname of the user",
        "id": 1,
        "name": "firstname",
        "placeholder": "firstname placeholder",
        "value": "Foo"
      }
    },
    {
      "_links": {
        "contract": {
          "href": "https://api.oneflow.com/v1/contracts/10015"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/10015/data_fields/2"
        }
      },
      "_private_ownerside": {
        "created_time": "2021-06-03T15:00:00+00:00",
        "custom_id": "lastname",
        "updated_time": null
      },
      "description": "lastname of the user",
      "id": 2,
      "name": "lastname",
      "placeholder": "lastname placeholder",
      "value": "Bar"
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns the list of data fields in a contract.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Get a contract data field by ID

/contracts/{contract_id}/data_fields/{data_field_id}

Use this endpoint to retrieve a specific contract data field by its ID.

GET /contracts/{contract_id}/data_fields/{data_field_id}


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.
data_field_idinteger(id)The unique ID of the contract data field.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/contracts/10015/data_fields/1001 \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/data_fields/1001"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample contract data field:

{
  "_links": {
    "contract": {
      "href": "https://api.oneflow.com/v1/contracts/10015"
    },
    "self": {
      "href": "https://api.oneflow.com/v1/contracts/10015/data_fields/1001"
    }
  },
  "_private_ownerside": {
    "created_time": "2021-06-03T15:00:00+00:00",
    "custom_id": "firstname",
    "updated_time": null
  },
  "description": "firstname of the user",
  "id": 1001,
  "name": "firstname",
  "placeholder": "firstname placeholder",
  "value": "Foo"
}

Response codes

StatusMeaningDescription
200OKReturns the requested contract data field.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Create a contract

/contracts/create

Use this endpoint to create a new contract based on the selected template.

POST /contracts/create


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Request body

Request body parameters for creating a contract.
Fields marked with * are mandatory, and the top-level attributes are shown in bold.

Expand
NameDescription
workspace_id*integer(signed_integer_id)
The unique ID of the workspace.
data_fieldsarray[object]
The data fields to be included in the contract.
minItems:0, maxItems:150
custom_id*string
The unique name that was given to the data field when it was added to the template type.
minLength: 1, maxLength: 100
value*string or null
The value that will be displayed in the contract for the data field.
maxLength: 1024
namestring
minLength: 0, maxLength: 130
template_id*integer(signed_integer_id)
The unique ID of the template.
my_partyobject
Legal entity representing the party of the current user's Oneflow account (the owner side party).
country_codestring(country_code)
The country of the contract party.
identification_numberstring
The unique organization number of the contract party.
minLength: 0, maxLength: 25
namestring
The name of the owner side party.
minLength: 1, maxLength: 100
participants*array[object]
The list of participants in the owner side party.
minItems:1, maxItems:29
  _permissionsobject
Defines permissions for the participant on the contract.
    contract:update*boolean
If true, the participant is allowed to update the contract.
  email*string(email)
The email of the contract participant. Note that the email must belong to an active user in your Oneflow account.
  identification_numberstring
The social security number of the participant.
minLength: 0, maxLength: 25
  namestring
The name of the participant.
minLength: 1, maxLength: 100
  organizerboolean
If true, the participant is the organizer of the contract.
  phone_numberstring or null
The phone number of the participant.
minLength: 0, maxLength: 50
  signatoryboolean
If true, the participant becomes the signatory of the contract.
  titlestring
The title of the participant.
maxLength: 100
partiesarray[object]
The list of parties in the contract, representing companies, organizations, government departments, etc. Each party object must follow the object representation of either the individual or the company type of party.
minItems:1, maxItems:30
object
The contract party of the individual type with a single participant who signs the contract on his or her own behalf.
  country_codestring(country_code)
The country code of the individual contract party.
  participant*object
The person who represents the contract party with the type individual; see Participant.
    _permissionsobject
Defines permissions for the participant on the contract.
      contract:update*boolean
If set to true, the participant is allowed to update the contract.
    delivery_channel*string(enum)
One of the contract delivery channels.
    emailstring(email)
The participant's email. If the delivery channel is ‘email,’ then the participant's email is required.
    identification_numberstring
The social security number of the participant.
minLength: 0, maxLength: 25
    name*string
The participant’s name.
minLength: 1, maxLength: 100
    phone_numberstring or null
The participant's phone number. If the delivery channel is ‘phone number,’ then the participant's phone number is required.
minLength: 0, maxLength: 50
    sign_methodstring(enum)
One of the sign methods.
    signatoryboolean
If true, the participant can sign the contract.
    titlestring
The title of the participant.
minLength: 0, maxLength: 100
    two_step_authentication_methodstring(enum)
One of the two step authentication methods.
  type*string(enum)
The contract party type.
object
The contract party with the company type is a legal entity involved in the contract. More than one participant can sign a contract on behalf of the party with the company type.
  country_codestring(country_code)
The country code of the contract party.
  identification_numberstring
The unique organization number of the contract party.
minLength: 0, maxLength: 25
  name*string
The name of the contract party.
minLength: 1, maxLength: 100
  participants*array[object]
The list of the contract party participants.
minItems:1, maxItems:30
    _permissionsobject
Defines permissions for the participant on the contract.
      contract:update*boolean
If set to true, the participant is allowed to update the contract.
    delivery_channel*string(enum)
One of the contract delivery channels.
    emailstring(email)
The participant's email. If the delivery channel is ‘email,’ then the participant's email is required.
    identification_numberstring
The social security number of the participant.
minLength: 0, maxLength: 25
    name*string
The participant’s name.
minLength: 1, maxLength: 100
    phone_numberstring or null
The participant's phone number. If the delivery channel is ‘phone number,’ then the participant's phone number is required.
minLength: 0, maxLength: 50
    sign_methodstring(enum)
One of the sign methods.
    signatoryboolean
If true, the participant can sign the contract.
    titlestring
The title of the participant.
minLength: 0, maxLength: 100
    two_step_authentication_methodstring(enum)
One of the two step authentication methods.
  type*string(enum)
The contract party type.
product_groupsarray[object]
The list of product groups. Currently, it is possible to add a single product group, but more might be allowed in the future. Ensure that the template for your contract contains exactly one product table; otherwise, the product_groups setting will fail. Note that we limit the total amount of products per contract to 150. This amount includes products from all product tables.
minItems:0, maxItems:1
products*array[object]
The array of products in this group.
minItems:0, maxItems:150
  counterparty_lockboolean
  descriptionstring
The product description.
minLength: 0, maxLength: 3000
  name*string
The product name.
minLength: 1, maxLength: 80
  price_1object or null
The object holds all price-related information for an individual product. Note that base_amount must be larger than discount_amount, except if the base_amount is 0, which is an exception to allow negative prices.
    base_amount*object
The base price of one item of this kind of product without considering discounts.
      amount*string(amount)
An amount specifying the base price.
    discount_amountobject
The discount on the base price.
      amount*string(amount)
An amount specifying the discount.
    discount_percentstring(discount_percent)
The discount percentage is a decimal string between "0" and "100".
  price_2object or null
The object holds all price-related information for an individual product. Note that base_amount must be larger than discount_amount, except if the base_amount is 0, which is an exception to allow negative prices.
    base_amount*object
The base price of one item of this kind of product without considering discounts.
      amount*string(amount)
An amount specifying the base price.
    discount_amountobject
The discount on the base price.
      amount*string(amount)
An amount specifying the discount.
    discount_percentstring(discount_percent)
The discount percentage is a decimal string between "0" and "100".
  quantity*object
The object holds information about the quantity of an individual product. The default quantity type is multiple. If the quantity type is single, the amount must be set to 0 or 1. If the quantity type is set to exclusive, the quantity type must be set to 1 for at most one product and 0 for all other products in the same product group with the quantity type exclusive.
    amountinteger or null
The number of individual products selected, or the quantity.
minimum: 0, maximum: 99999999
    typestring(enum)
One of the product's quantity types.
valueobject or null
The deal size of a contract as an amount of money.
amount*string(amount)
An amount specifying the total value.

Request body example

{
  "workspace_id": 90003,
  "data_fields": [
    {
      "custom_id": "first-name",
      "value": "firstname"
    }
  ],
  "template_id": 10023,
  "name": "My First Contract",
  "value": {
    "amount": "500.10"
  },
  "my_party": {
    "country_code": "SE",
    "identification_number": "11223344-5566",
    "name": "Own Company AB",
    "participants": [
      {
        "email": "[email protected]",
        "identification_number": "10034544-0066",
        "name": "First Last",
        "phone_number": "+111222333444",
        "signatory": true,
        "organizer": false,
        "_permissions": {
          "contract:update": true
        },
        "title": "Sales Manager"
      }
    ]
  },
  "parties": [
    {
      "country_code": "SE",
      "identification_number": "11223344-5566",
      "name": "Company AB",
      "type": "company",
      "participants": [
        {
          "delivery_channel": "email",
          "email": "[email protected]",
          "identification_number": "10034544-0066",
          "name": "First Last",
          "phone_number": "+111222333555",
          "sign_method": "standard_esign",
          "signatory": true,
          "two_step_authentication_method": "email",
          "_permissions": {
            "contract:update": true
          }
        }
      ]
    },
    {
      "country_code": "SE",
      "type": "individual",
      "participant": {
        "delivery_channel": "email",
        "email": "[email protected]",
        "identification_number": "10034544-0066",
        "name": "First Last",
        "phone_number": "+111222333666",
        "sign_method": "standard_esign",
        "signatory": true,
        "two_step_authentication_method": "email",
        "_permissions": {
          "contract:update": true
        }
      }
    }
  ]
}

Code example

curl --request POST \
  --url https://api.oneflow.com/v1/contracts/create \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]' \
  --data '{"workspace_id":90003,"data_fields":[{"custom_id":"first-name","value":"firstname"}],"template_id":10023,"name":"My First Contract","value":{"amount":"500.10"},"my_party":{"country_code":"SE","identification_number":"11223344-5566","name":"Own Company AB","participants":[{"email":"[email protected]","identification_number":"10034544-0066","name":"First Last","phone_number":"+111222333444","signatory":true,"organizer":false,"_permissions":{"contract:update":true},"title":"Sales Manager"}]},"parties":[{"country_code":"SE","identification_number":"11223344-5566","name":"Company AB","type":"company","participants":[{"delivery_channel":"email","email":"[email protected]","identification_number":"10034544-0066","name":"First Last","phone_number":"+111222333555","sign_method":"standard_esign","signatory":true,"two_step_authentication_method":"email","_permissions":{"contract:update":true}}]},{"country_code":"SE","type":"individual","participant":{"delivery_channel":"email","email":"[email protected]","identification_number":"10034544-0066","name":"First Last","phone_number":"+111222333666","sign_method":"standard_esign","signatory":true,"two_step_authentication_method":"email","_permissions":{"contract:update":true}}}]}'
import requests

url = "https://api.oneflow.com/v1/contracts/create"

payload = {
    "workspace_id": 90003,
    "data_fields": [
        {
            "custom_id": "first-name",
            "value": "firstname"
        }
    ],
    "template_id": 10023,
    "name": "My First Contract",
    "value": {"amount": "500.10"},
    "my_party": {
        "country_code": "SE",
        "identification_number": "11223344-5566",
        "name": "Own Company AB",
        "participants": [
            {
                "email": "[email protected]",
                "identification_number": "10034544-0066",
                "name": "First Last",
                "phone_number": "+111222333444",
                "signatory": True,
                "organizer": False,
                "_permissions": {"contract:update": True},
                "title": "Sales Manager"
            }
        ]
    },
    "parties": [
        {
            "country_code": "SE",
            "identification_number": "11223344-5566",
            "name": "Company AB",
            "type": "company",
            "participants": [
                {
                    "delivery_channel": "email",
                    "email": "[email protected]",
                    "identification_number": "10034544-0066",
                    "name": "First Last",
                    "phone_number": "+111222333555",
                    "sign_method": "standard_esign",
                    "signatory": True,
                    "two_step_authentication_method": "email",
                    "_permissions": {"contract:update": True}
                }
            ]
        },
        {
            "country_code": "SE",
            "type": "individual",
            "participant": {
                "delivery_channel": "email",
                "email": "[email protected]",
                "identification_number": "10034544-0066",
                "name": "First Last",
                "phone_number": "+111222333666",
                "sign_method": "standard_esign",
                "signatory": True,
                "two_step_authentication_method": "email",
                "_permissions": {"contract:update": True}
            }
        }
    ]
}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

Response example

A sample contract with parties and products:

{
  "_links": {
    "data_fields": {
      "href": "https://api.oneflow.com/v1/contracts/10015/data_fields"
    },
    "events": {
      "href": "https://api.oneflow.com/v1/contracts/10015/events"
    },
    "files": {
      "href": "https://api.oneflow.com/v1/contracts/10015/files"
    },
    "parties": {
      "href": "https://api.oneflow.com/v1/contracts/10015/parties"
    },
    "publish": {
      "href": "https://api.oneflow.com/v1/contracts/10015/publish"
    },
    "self": {
      "href": "https://api.oneflow.com/v1/contracts/10015"
    },
    "template": {
      "href": "https://api.oneflow.com/v1/templates/11111"
    },
    "template_type": {
      "href": "https://api.oneflow.com/v1/template_types/12222"
    },
    "workspace": {
      "href": "https://api.oneflow.com/v1/workspaces/12345"
    }
  },
  "_permissions": {
    "contract:delete": true
  },
  "_private": {
    "name": "My First Contract",
    "value": {
      "amount": "500.10",
      "currency": "SEK"
    },
    "workspace_id": 12345
  },
  "_private_ownerside": {
    "created_time": "2020-06-30T07:15:23+00:00",
    "template_id": 11111,
    "template_type_id": 12222
  },
  "available_options": {
    "can_receive_attachments": false,
    "can_receive_expanded_pdf": false,
    "can_receive_products": false,
    "delivery_channels": [
      {
        "name": "email",
        "preferred": false,
        "required_participant_attributes": [
          "email"
        ]
      },
      {
        "name": "none",
        "preferred": false,
        "required_participant_attributes": []
      },
      {
        "name": "same_device",
        "preferred": true,
        "required_participant_attributes": []
      }
    ],
    "sign_methods": [
      {
        "name": "norwegian_bankid",
        "preferred": false
      },
      {
        "name": "standard_esign",
        "preferred": false
      },
      {
        "name": "swedish_bankid",
        "preferred": true
      }
    ],
    "two_step_authentication_methods": [
      {
        "name": "email",
        "preferred": true,
        "required_participant_attributes": [
          "email"
        ]
      },
      {
        "name": "none",
        "preferred": false,
        "required_participant_attributes": []
      }
    ]
  },
  "data_fields": [
    {
      "_private_ownerside": {
        "created_time": "2021-06-03T15:00:00+00:00",
        "custom_id": "firstname",
        "updated_time": null
      },
      "description": "firstname of the user",
      "id": 1,
      "name": "firstname",
      "placeholder": "firstname placeholder",
      "value": "Foo"
    },
    {
      "_private_ownerside": {
        "created_time": "2021-06-03T15:00:00+00:00",
        "custom_id": "lastname",
        "updated_time": null
      },
      "description": "lastname of the user",
      "id": 2,
      "name": "lastname",
      "placeholder": "lastname placeholder",
      "value": "Bar"
    }
  ],
  "id": 10015,
  "lifecycle_settings": {
    "duration": "12m",
    "end_date": null,
    "initial_duration": null,
    "notice_period": "3m",
    "start_date": "2020-07-09",
    "type": "recurring"
  },
  "lifecycle_state": {
    "contract_end_time": null,
    "contract_start_time": "2020-07-09T00:00:00+00:00",
    "cancel_time": null,
    "has_ended_by_termination": false,
    "has_passed_notice_period_start_time": true,
    "is_canceled": false,
    "is_recurring": true,
    "lifecycle_state": "active",
    "lifecycle_state_updated_time": "2020-07-09T12:54:53+00:00",
    "notice_period_start_time": "2021-04-09T00:00:00+00:00",
    "period": 1,
    "period_end_time": "2021-07-09T00:00:00+00:00",
    "period_start_time": "2020-07-09T00:00:00+00:00"
  },
  "parties": [
    {
      "_private_ownerside": {
        "created_time": "2020-06-30T07:15:23+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 353218,
      "identification_number": "11223344-5566",
      "my_party": true,
      "name": "Own Company AB",
      "participants": [
        {
          "_permissions": {
            "contract:update": true
          },
          "_private_ownerside": {
            "created_time": "2020-06-30T07:15:23+00:00",
            "first_visited_time": "2020-06-30T07:15:23+00:00",
            "last_visited_time": "2020-08-04T10:14:30+00:00",
            "updated_time": "2020-08-04T10:14:30+00:00",
            "visits": 5
          },
          "delivery_channel": "email",
          "delivery_status": "success",
          "email": "[email protected]",
          "id": 113703,
          "identification_number": "",
          "my_participant": false,
          "name": "First Last",
          "organizer": false,
          "phone_number": "",
          "sign_method": "standard_esign",
          "sign_state": "signed",
          "sign_state_updated_time": "2020-07-09T12:53:54+00:00",
          "signatory": true,
          "title": "Sales Manager",
          "two_step_authentication_method": "none"
        }
      ],
      "type": "company"
    },
    {
      "_private_ownerside": {
        "created_time": "2020-06-30T07:17:17+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 353219,
      "identification_number": "111111",
      "my_party": false,
      "name": "Company AB",
      "participants": [
        {
          "_permissions": {
            "contract:update": true
          },
          "_private_ownerside": {
            "created_time": "2020-06-30T07:17:17+00:00",
            "first_visited_time": "2020-07-09T12:54:42+00:00",
            "last_visited_time": "2020-07-09T12:54:55+00:00",
            "updated_time": "2020-07-09T12:55:00+00:00",
            "visits": 3
          },
          "delivery_channel": "email",
          "delivery_status": "success",
          "email": "[email protected]",
          "id": 113704,
          "identification_number": "",
          "my_participant": false,
          "name": "Endpoint Test",
          "organizer": false,
          "phone_number": "+111222333444",
          "sign_method": "standard_esign",
          "sign_state": "signed",
          "sign_state_updated_time": "2020-07-09T12:54:53+00:00",
          "signatory": true,
          "title": "",
          "two_step_authentication_method": "email"
        }
      ],
      "type": "company"
    },
    {
      "_private_ownerside": {
        "created_time": "2020-07-04T11:59:13+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 350398,
      "identification_number": "10034544-0066",
      "my_party": false,
      "name": "First Last",
      "participant": {
        "_permissions": {
          "contract:update": true
        },
        "_private_ownerside": {
          "created_time": "2020-07-04T11:59:13+00:00",
          "first_visited_time": null,
          "last_visited_time": null,
          "updated_time": "2020-07-04T11:59:13+00:00",
          "visits": 0
        },
        "delivery_channel": "email",
        "delivery_status": "success",
        "email": "[email protected]",
        "id": 170397,
        "identification_number": "10034544-0066",
        "my_participant": false,
        "name": "First Last",
        "organizer": false,
        "phone_number": "+111222333666",
        "sign_method": "standard_esign",
        "sign_state": "undecided",
        "sign_state_updated_time": null,
        "signatory": true,
        "title": "",
        "two_step_authentication_method": "email"
      },
      "type": "individual"
    }
  ],
  "product_groups": [
    {
      "_private_ownerside": {
        "created_time": "2021-01-29T08:55:46+00:00",
        "updated_time": "2021-01-29T08:55:46+00:00"
      },
      "id": 75861,
      "products": [
        {
          "_private_ownerside": {
            "created_time": "2021-01-29T08:55:46+00:00",
            "updated_time": "2021-01-29T08:55:46+00:00"
          },
          "counterparty_lock": false,
          "description": "shiny shoes for sunny saunters",
          "id": 135805,
          "name": "shoes",
          "price_1": {
            "amount": {
              "amount": "90.00"
            },
            "base_amount": {
              "amount": "100.00"
            },
            "discount_amount": {
              "amount": "0.00"
            },
            "discount_percent": "10.000"
          },
          "price_2": {
            "amount": {
              "amount": "0.00"
            },
            "base_amount": {
              "amount": "0.00"
            },
            "discount_amount": {
              "amount": "0.00"
            },
            "discount_percent": "0.000"
          },
          "quantity": {
            "amount": 1,
            "type": "multiple_choice"
          }
        }
      ]
    }
  ],
  "published_time": null,
  "signing_period_expiry_time": "2020-07-15T00:00:00+00:00",
  "state": "draft",
  "state_updated_time": "2020-07-09T12:54:53+00:00",
  "updated_time": "2020-07-09T12:54:57+00:00"
}

Response codes

StatusMeaningDescription
200OKReturns the created contract.
400Bad RequestInvalid format or content of the request.
404Not FoundA required entity is missing.
409ConflictA conflict occurred with the current state of the target resource.

Create an access link

/contracts/{contract_id}/participants/{participant_id}/access_link

Use this endpoint to create an access link to a contract for a specific participant.

POST /contracts/{contract_id}/participants/{participant_id}/access_link


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.
participant_idinteger(id)The ID of a participant in a contract.

Code example

curl --request POST \
  --url https://api.oneflow.com/v1/contracts/10015/participants/10015/access_link \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/participants/10015/access_link"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675"
}

response = requests.request("POST", url, headers=headers)

print(response.text)

Response example

An access link example for to a contract for a specific participant:

{
  "access_link": "https://app.oneflow.com/contracts/154555/at/eb5c66c70789424bbe4433ad01ab6b6dc5864934"
}

Response codes

StatusMeaningDescription
200OKThe requested access link to a contract for a specific participant.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Publish a contract by ID

/contracts/{contract_id}/publish

Use this endpoint to send contract to participants.

POST /contracts/{contract_id}/publish


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.

Request body

Request body parameters used for sending contract with message to participants.
Fields marked with * are mandatory, and the top-level attributes are shown in bold.

Expand
NameDescription
subject*string
Subject of the message for sending invitation for the contract.
minLength: 1, maxLength: 150
message*string
Message to be sent along with the invitation for the contract.
minLength: 1, maxLength: 5000

Request body example

{
  "subject": "Contract subject",
  "message": "Contract sample message, use this space to additional message with the contract."
}

Code example

curl --request POST \
  --url https://api.oneflow.com/v1/contracts/10015/publish \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]' \
  --data '{"subject":"Contract subject","message":"Contract sample message, use this space to additional message with the contract."}'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/publish"

payload = {
    "subject": "Contract subject",
    "message": "Contract sample message, use this space to additional message with the contract."
}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

Response example

A sample contract with parties and products:

{
  "_links": {
    "events": {
      "href": "https://api.oneflow.com/v1/contracts/51874/events"
    },
    "files": {
      "href": "https://api.oneflow.com/v1/contracts/51874/files"
    },
    "parties": {
      "href": "https://api.oneflow.com/v1/contracts/51874/parties"
    },
    "publish": {
      "href": "https://api.oneflow.com/v1/contracts/51874/publish"
    },
    "self": {
      "href": "https://api.oneflow.com/v1/contracts/51874"
    },
    "template": {
      "href": "https://api.oneflow.com/v1/templates/11111"
    },
    "template_type": {
      "href": "https://api.oneflow.com/v1/template_types/12222"
    },
    "workspace": {
      "href": "https://api.oneflow.com/v1/workspaces/12345"
    }
  },
  "_permissions": {
    "contract:delete": true
  },
  "_private": {
    "name": "My First Contract",
    "value": {
      "amount": "500.10",
      "currency": "SEK"
    },
    "workspace_id": 12345
  },
  "_private_ownerside": {
    "created_time": "2020-06-30T07:15:23+00:00",
    "template_id": 11111,
    "template_type_id": 12222
  },
  "available_options": {
    "can_receive_attachments": false,
    "can_receive_expanded_pdf": false,
    "can_receive_products": false,
    "delivery_channels": [
      {
        "name": "email",
        "preferred": false,
        "required_participant_attributes": [
          "email"
        ]
      },
      {
        "name": "none",
        "preferred": false,
        "required_participant_attributes": []
      },
      {
        "name": "same_device",
        "preferred": true,
        "required_participant_attributes": []
      }
    ],
    "sign_methods": [
      {
        "name": "norwegian_bankid",
        "preferred": false
      },
      {
        "name": "standard_esign",
        "preferred": false
      },
      {
        "name": "swedish_bankid",
        "preferred": true
      }
    ],
    "two_step_authentication_methods": [
      {
        "name": "email",
        "preferred": true,
        "required_participant_attributes": [
          "email"
        ]
      },
      {
        "name": "none",
        "preferred": false,
        "required_participant_attributes": []
      }
    ]
  },
  "data_fields": [
    {
      "_private_ownerside": {
        "created_time": "2021-06-03T15:00:00+00:00",
        "custom_id": "firstname",
        "updated_time": null
      },
      "description": "firstname of the user",
      "id": 1,
      "name": "firstname",
      "placeholder": "firstname placeholder",
      "value": "Foo"
    },
    {
      "_private_ownerside": {
        "created_time": "2021-06-03T15:00:00+00:00",
        "custom_id": "lastname",
        "updated_time": null
      },
      "description": "lastname of the user",
      "id": 2,
      "name": "lastname",
      "placeholder": "lastname placeholder",
      "value": "Bar"
    }
  ],
  "id": 51874,
  "lifecycle_settings": {
    "duration": "12m",
    "end_date": null,
    "initial_duration": null,
    "notice_period": "3m",
    "start_date": "2021-07-09",
    "type": "recurring"
  },
  "lifecycle_state": null,
  "parties": [
    {
      "_private_ownerside": {
        "created_time": "2020-06-30T07:15:23+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 353218,
      "identification_number": "11223344-5566",
      "my_party": true,
      "name": "My Company AB",
      "participants": [
        {
          "_permissions": {
            "contract:update": true
          },
          "_private_ownerside": {
            "created_time": "2020-06-30T07:15:23+00:00",
            "first_visited_time": "2020-06-30T07:15:23+00:00",
            "last_visited_time": "2020-08-04T10:14:30+00:00",
            "updated_time": "2020-08-04T10:14:30+00:00",
            "visits": 5
          },
          "delivery_channel": "email",
          "delivery_status": "success",
          "email": "[email protected]",
          "id": 113703,
          "identification_number": "",
          "my_participant": true,
          "name": "First Last",
          "organizer": false,
          "phone_number": "",
          "sign_method": "standard_esign",
          "sign_state": "undecided",
          "sign_state_updated_time": null,
          "signatory": true,
          "title": "",
          "two_step_authentication_method": "none"
        }
      ],
      "type": "company"
    },
    {
      "_private_ownerside": {
        "created_time": "2020-06-30T07:17:17+00:00",
        "updated_time": null
      },
      "country_code": "SE",
      "id": 353219,
      "identification_number": "111111",
      "my_party": false,
      "name": "Endpoint Test",
      "participants": [
        {
          "_permissions": {
            "contract:update": true
          },
          "_private_ownerside": {
            "created_time": "2020-06-30T07:17:17+00:00",
            "first_visited_time": "2020-07-09T12:54:42+00:00",
            "last_visited_time": "2020-07-09T12:54:55+00:00",
            "updated_time": "2020-07-09T12:55:00+00:00",
            "visits": 3
          },
          "delivery_channel": "email",
          "delivery_status": "success",
          "email": "[email protected]",
          "id": 113704,
          "identification_number": "",
          "my_participant": false,
          "name": "Endpoint Test",
          "organizer": false,
          "phone_number": "+111222333444",
          "sign_method": "standard_esign",
          "sign_state": "undecided",
          "sign_state_updated_time": null,
          "signatory": true,
          "title": "",
          "two_step_authentication_method": "email"
        }
      ],
      "type": "company"
    }
  ],
  "product_groups": [
    {
      "_private_ownerside": {
        "created_time": "2021-01-29T08:55:46+00:00",
        "updated_time": "2021-01-29T08:55:46+00:00"
      },
      "id": 75861,
      "products": [
        {
          "_private_ownerside": {
            "created_time": "2021-01-29T08:55:46+00:00",
            "updated_time": "2021-01-29T08:55:46+00:00"
          },
          "counterparty_lock": false,
          "description": "shiny shoes for sunny saunters",
          "id": 135805,
          "name": "shoes",
          "price_1": {
            "amount": {
              "amount": "90.00"
            },
            "base_amount": {
              "amount": "100.00"
            },
            "discount_amount": {
              "amount": "0.00"
            },
            "discount_percent": "10.000"
          },
          "price_2": {
            "amount": {
              "amount": "0.00"
            },
            "base_amount": {
              "amount": "0.00"
            },
            "discount_amount": {
              "amount": "0.00"
            },
            "discount_percent": "0.000"
          },
          "quantity": {
            "amount": 1,
            "type": "multiple_choice"
          }
        }
      ]
    }
  ],
  "published_time": "2021-07-27T07:38:55+00:00",
  "signing_period_expiry_time": "2021-07-30T00:00:00+00:00",
  "state": "pending",
  "state_updated_time": "2020-07-27T12:54:53+00:00",
  "updated_time": "2020-07-27T12:54:57+00:00"
}

Response codes

StatusMeaningDescription
200OKReturns the contract.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
402Payment RequiredThe feature is not available for your current subscription plan.
403ForbiddenThe request is not authorized by the server.
404Not FoundA required entity is missing.
409ConflictA conflict occurred with the current state of the target resource.

Templates

Get templates

/templates

Use this endpoint to retrieve the list of templates available for the specified user.

GET /templates


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Query parameters

NameTypeRequiredDescription
sortstringfalseThe list of columns separated by ',' to sort the results.
offsetintegerfalseminimum: 0, maximum: 19900
limitintegerfalseminimum: 1, maximum: 100

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/templates \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/templates"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response with a list of templates:

{
  "_links": {
    "next": {
      "href": null
    },
    "previous": {
      "href": "https://api.oneflow.com/v1/templates?offset=0&limit=1"
    },
    "self": {
      "href": "https://api.oneflow.com/v1/templates?offset=1&limit=1"
    }
  },
  "count": 2,
  "data": [
    {
      "_links": {
        "self": {
          "href": "https://api.oneflow.com/v1/templates/110008"
        },
        "template_type": {
          "href": null
        }
      },
      "available_options": {
        "can_receive_attachments": false,
        "can_receive_expanded_pdf": false,
        "can_receive_products": false,
        "delivery_channels": [
          {
            "name": "email",
            "preferred": true,
            "required_participant_attributes": [
              "email"
            ]
          },
          {
            "name": "none",
            "preferred": false,
            "required_participant_attributes": []
          }
        ],
        "sign_methods": [
          {
            "name": "standard_esign",
            "preferred": true
          }
        ],
        "two_step_authentication_methods": [
          {
            "name": "email",
            "preferred": false,
            "required_participant_attributes": [
              "email"
            ]
          },
          {
            "name": "none",
            "preferred": true,
            "required_participant_attributes": []
          }
        ]
      },
      "created_time": "2021-05-04T12:00:09+00:00",
      "id": 110008,
      "name": "Sales Proposal",
      "template_type": null,
      "updated_time": "2021-06-08T06:54:42+00:00"
    },
    {
      "_links": {
        "self": {
          "href": "https://api.oneflow.com/v1/templates/110010"
        },
        "template_type": {
          "href": "https://api.oneflow.com/v1/template_types/5"
        }
      },
      "available_options": {
        "can_receive_attachments": false,
        "can_receive_expanded_pdf": true,
        "can_receive_products": false,
        "delivery_channels": [
          {
            "name": "email",
            "preferred": true,
            "required_participant_attributes": [
              "email"
            ]
          },
          {
            "name": "none",
            "preferred": false,
            "required_participant_attributes": []
          }
        ],
        "sign_methods": [
          {
            "name": "standard_esign",
            "preferred": true
          }
        ],
        "two_step_authentication_methods": [
          {
            "name": "email",
            "preferred": false,
            "required_participant_attributes": [
              "email"
            ]
          },
          {
            "name": "none",
            "preferred": true,
            "required_participant_attributes": []
          }
        ]
      },
      "created_time": "2021-05-05T07:40:11+00:00",
      "id": 110010,
      "name": "Code of Conduct",
      "template_type": {
        "created_time": "2021-05-27T16:45:56+00:00",
        "description": "Hubspot data fields",
        "extension_type": "hubspot",
        "id": 5,
        "name": "Hubspot Template",
        "updated_time": "2021-06-07T07:43:39+00:00"
      },
      "updated_time": "2021-06-07T07:43:39+00:00"
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns the list of templates.
400Bad RequestInvalid format or content of the request.

Get a template by ID

/templates/{template_id}

Use this endpoint to retrieve a specific template by its ID.

GET /templates/{template_id}


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
template_idinteger(id)The unique ID of the template.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/templates/110008 \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/templates/110008"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response of a template:

{
  "_links": {
    "self": {
      "href": "https://api.oneflow.com/v1/templates/110008"
    },
    "template_type": {
      "href": "https://api.oneflow.com/v1/template_types/5"
    }
  },
  "available_options": {
    "can_receive_attachments": false,
    "can_receive_expanded_pdf": false,
    "can_receive_products": false,
    "delivery_channels": [
      {
        "name": "email",
        "preferred": true,
        "required_participant_attributes": [
          "email"
        ]
      },
      {
        "name": "none",
        "preferred": false,
        "required_participant_attributes": []
      }
    ],
    "sign_methods": [
      {
        "name": "standard_esign",
        "preferred": true
      }
    ],
    "two_step_authentication_methods": [
      {
        "name": "email",
        "preferred": false,
        "required_participant_attributes": [
          "email"
        ]
      },
      {
        "name": "none",
        "preferred": true,
        "required_participant_attributes": []
      }
    ]
  },
  "created_time": "2021-05-04T12:00:09+00:00",
  "id": 110008,
  "name": "Sales Proposal",
  "template_type": {
    "created_time": "2021-05-27T16:45:56+00:00",
    "description": "Hubspot data fields",
    "extension_type": "hubspot",
    "id": 5,
    "name": "Hubspot Template"
  },
  "updated_time": "2021-06-08T06:54:42+00:00"
}

Response codes

StatusMeaningDescription
200OKReturns the requested template.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Helpers

Get data to create a contract

/helpers/contract_create_data

Use this endpoint to retrieve the workspaces with their templates. This data is essential for creating a contract.

GET /helpers/contract_create_data


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Query parameters

NameTypeRequiredDescription
extension_typestring(enum)falseCross-account way of finding template groups used by specific integration extensions. Set by Oneflow when the extension is created.
template_type_idinteger(id)falseThe unique ID of the template type.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/helpers/contract_create_data \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/helpers/contract_create_data"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample returned data with workspaces and templates:

[
  {
    "id": 121212,
    "name": "Oneflow users",
    "templates": [
      {
        "available_options": {
          "can_receive_attachments": true,
          "can_receive_expanded_pdf": false,
          "can_receive_products": true,
          "delivery_channels": [
            {
              "name": "email",
              "preferred": true,
              "required_participant_attributes": [
                "email"
              ]
            },
            {
              "name": "none",
              "preferred": false,
              "required_participant_attributes": []
            }
          ],
          "sign_methods": [
            {
              "name": "standard_esign",
              "preferred": true
            }
          ],
          "two_step_authentication_methods": [
            {
              "name": "email",
              "preferred": true,
              "required_participant_attributes": [
                "email"
              ]
            },
            {
              "name": "none",
              "preferred": false,
              "required_participant_attributes": []
            }
          ]
        },
        "created_time": "2020-05-04T12:00:20+00:00",
        "id": 1186806,
        "name": "Sales Template",
        "template_type": null,
        "updated_time": "2020-05-12T13:40:10+00:00"
      },
      {
        "available_options": {
          "can_receive_attachments": false,
          "can_receive_expanded_pdf": true,
          "can_receive_products": false,
          "delivery_channels": [
            {
              "name": "email",
              "preferred": true,
              "required_participant_attributes": [
                "email"
              ]
            },
            {
              "name": "none",
              "preferred": false,
              "required_participant_attributes": []
            }
          ],
          "sign_methods": [
            {
              "name": "standard_esign",
              "preferred": true
            }
          ],
          "two_step_authentication_methods": [
            {
              "name": "email",
              "preferred": false,
              "required_participant_attributes": [
                "email"
              ]
            },
            {
              "name": "none",
              "preferred": true,
              "required_participant_attributes": []
            }
          ]
        },
        "created_time": "2020-05-04T12:00:20+00:00",
        "id": 1186807,
        "name": "Sample Hubspot Template",
        "template_type": {
          "created_time": "2020-04-27T16:45:40+00:00",
          "description": "Hubspot data fields",
          "extension_type": "hubspot",
          "id": 1,
          "name": "Hubspot Template",
          "updated_time": "2020-06-07T07:30:00+00:00"
        },
        "updated_time": "2020-05-12T13:40:10+00:00"
      }
    ],
    "updated_time": "2020-06-11T13:44:42+00:00"
  }
]

Response codes

StatusMeaningDescription
200OKReturns the workspaces with embedded templates for creating a contract.
400Bad RequestInvalid format or content of the request.
403ForbiddenThe request is not authorized by the server.

Get data fields

/helpers/template_types/{template_type_id}/data_fields

Use this endpoint to return the data fields of the specified template type.

GET /helpers/template_types/{template_type_id}/data_fields


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
template_type_idinteger(id)The unique ID of the template type.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/helpers/template_types/1001/data_fields \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/helpers/template_types/1001/data_fields"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response with a list of data fields:

{
  "data_fields": [
    {
      "active": true,
      "custom_id": "first_name",
      "description": "First name of the user.",
      "id": 1,
      "name": "First Name",
      "placeholder": "firstname",
      "source": "user",
      "value": "john",
      "_links": {
        "template_type": {
          "href": "https://api.oneflow.com/v1/template_types/1001"
        }
      }
    },
    {
      "active": false,
      "custom_id": "last_name",
      "description": "Last name of the user.",
      "id": 2,
      "name": "Last Name",
      "placeholder": "lastname",
      "source": "system",
      "value": "paul",
      "_links": {
        "template_type": {
          "href": "https://api.oneflow.com/v1/template_types/1001"
        }
      }
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns data fields of the specified template type.
400Bad RequestInvalid format or content of the request.
404Not FoundA required entity is missing.

Template types

Get template types

/template_types

Use this endpoint to retrieve a list of template types available for the specified user.

GET /template_types


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Query parameters

NameTypeRequiredDescription
extension_typestring(enum)falseCross-account way of finding template groups used by specific integration extensions. Set by Oneflow when the extension is created.
sortstringfalseThe list of columns separated by ',' to sort the results.
offsetintegerfalseminimum: 0, maximum: 19900
limitintegerfalseminimum: 1, maximum: 100

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/template_types \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/template_types"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response with a list of template types:

{
  "_links": {
    "next": {
      "href": "https://api.oneflow.com/v1/template_types?offset=1&limit=1"
    },
    "previous": {
      "href": null
    },
    "self": {
      "href": "https://api.oneflow.com/v1/template_types?offset=0&limit=1"
    }
  },
  "count": 2,
  "data": [
    {
      "created_time": "2020-10-27T16:45:56+00:00",
      "description": "simple template type",
      "extension_type": "hubspot",
      "id": 1002,
      "name": "test_template_types",
      "updated_time": "2020-10-27T16:45:56+00:00",
      "_links": {
        "self": {
          "href": "https://api.oneflow.com/v1/template_types/1002"
        }
      }
    },
    {
      "created_time": "2021-07-28T15:45:00+00:00",
      "description": "sample template type",
      "extension_type": "adocka",
      "id": 1003,
      "name": "sample_adocka_template_types",
      "updated_time": "2021-07-28T15:45:00+00:00",
      "_links": {
        "self": {
          "href": "https://api.oneflow.com/v1/template_types/1003"
        }
      }
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns the list of template types.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
403ForbiddenThe request is not authorized by the server.

Get template type by ID

/template_types/{template_type_id}

Use this endpoint to retrieve a specific template type by its ID.

GET /template_types/{template_type_id}


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)falseThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
template_type_idinteger(id)The unique ID of the template type.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/template_types/1001 \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/template_types/1001"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample template type with data fields:

{
  "_links": {
    "self": {
      "href": "https://api.oneflow.com/v1/template_types/1001"
    }
  },
  "active": true,
  "created_time": "2020-10-27T16:45:56+00:00",
  "data_fields": [
    {
      "active": true,
      "custom_id": "firstname",
      "description": "firstname of the user",
      "id": 1,
      "name": "firstname",
      "placeholder": "firstname",
      "source": "user",
      "value": "john"
    },
    {
      "active": false,
      "custom_id": "lastname",
      "description": "lastname of the user",
      "id": 2,
      "name": "lastname",
      "placeholder": "lastname",
      "source": "system",
      "value": "paul"
    }
  ],
  "description": "simple template type",
  "extension_type": "salesforce",
  "id": 1001,
  "name": "test_template_type",
  "updated_time": "2020-10-27T16:45:56+00:00"
}

Response codes

StatusMeaningDescription
200OKReturns the requested template type.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Update data fields

/template_types/{template_type_id}/data_fields

Use this endpoint to update all data fields in the specified template type. See the Data Field for more information.

PUT /template_types/{template_type_id}/data_fields


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
template_type_idinteger(id)The unique ID of the template type.

Request body

Request body details for updating data fields.
Fields marked with * are mandatory, and the top-level attributes are shown in bold.

Expand
NameDescription
data_fields*array[object]
The list of data fields that belong to the given template type.
minItems:0, maxItems:150
custom_id*string
The unique name that was given to the data field when it was added to the template type.
minLength: 1, maxLength: 100
descriptionstring
The description of the data field.
minLength: 0, maxLength: 300
name*string
The name of the data field.
minLength: 1, maxLength: 100
placeholderstring or null
The placeholder of the data field.
minLength: 0, maxLength: 100
valuestring or null
The value of the data field.
minLength: 0, maxLength: 1024

Request body example

{
  "data_fields": [
    {
      "custom_id": "participant_last_name",
      "description": "The last name of a participant in a contract.",
      "name": "Participant Last Name",
      "placeholder": "Last Name",
      "value": "Smith"
    },
    {
      "custom_id": "company_address",
      "name": "Company address",
      "value": "1234 Main Street"
    },
    {
      "custom_id": "participant_position",
      "name": "Participant's position in company."
    }
  ]
}

Code example

curl --request PUT \
  --url https://api.oneflow.com/v1/template_types/1001/data_fields \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]' \
  --data '{"data_fields":[{"custom_id":"participant_last_name","description":"The last name of a participant in a contract.","name":"Participant Last Name","placeholder":"Last Name","value":"Smith"},{"custom_id":"company_address","name":"Company address","value":"1234 Main Street"},{"custom_id":"participant_position","name":"Participant'\''s position in company."}]}'
import requests

url = "https://api.oneflow.com/v1/template_types/1001/data_fields"

payload = {"data_fields": [
        {
            "custom_id": "participant_last_name",
            "description": "The last name of a participant in a contract.",
            "name": "Participant Last Name",
            "placeholder": "Last Name",
            "value": "Smith"
        },
        {
            "custom_id": "company_address",
            "name": "Company address",
            "value": "1234 Main Street"
        },
        {
            "custom_id": "participant_position",
            "name": "Participant's position in company."
        }
    ]}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("PUT", url, json=payload, headers=headers)

print(response.text)

Response example

A sample response with a list of data fields:

{
  "data_fields": [
    {
      "active": true,
      "custom_id": "first_name",
      "description": "First name of the user.",
      "id": 1,
      "name": "First Name",
      "placeholder": "firstname",
      "source": "user",
      "value": "john",
      "_links": {
        "template_type": {
          "href": "https://api.oneflow.com/v1/template_types/1001"
        }
      }
    },
    {
      "active": false,
      "custom_id": "last_name",
      "description": "Last name of the user.",
      "id": 2,
      "name": "Last Name",
      "placeholder": "lastname",
      "source": "system",
      "value": "paul",
      "_links": {
        "template_type": {
          "href": "https://api.oneflow.com/v1/template_types/1001"
        }
      }
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns the created data fields information.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.
409ConflictA conflict occurred with the current state of the target resource.

Events

Get a contract event by ID

/contracts/{contract_id}/events/{event_id}

Use this endpoint to retrieve a specific contract event by its ID.

GET /contracts/{contract_id}/events/{event_id}


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.
event_idinteger(id)The unique ID of the event.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/contracts/10015/events/12 \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/events/12"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample of the contract:publish event:

{
  "_links": {
    "contract": {
      "href": "https://api.oneflow.com/v1/contracts/10015"
    },
    "self": {
      "href": "https://api.oneflow.com/v1/contracts/10015/events/12"
    }
  },
  "actor": {
    "id": 1,
    "name": "John",
    "party": {
      "id": 45,
      "name": "Example Company AB"
    }
  },
  "created_time": "2020-10-27T16:45:56+00:00",
  "data": {
    "changes": [],
    "subject": {
      "id": 345
    }
  },
  "id": 12,
  "type": "contract:publish"
}

Response codes

StatusMeaningDescription
200OKReturns the requested contract event.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Get contract events

/contracts/{contract_id}/events

Use this endpoint to retrieve the list of events available for the specified contract ID.

GET /contracts/{contract_id}/events


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.

Query parameters

NameTypeRequiredDescription
sortstringfalseThe list of columns separated by ',' to sort the results.
offsetintegerfalseminimum: 0, maximum: 19900
limitintegerfalseminimum: 1, maximum: 100

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/contracts/10015/events \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/events"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample of the contract events list:

{
  "_links": {
    "next": {
      "href": null
    },
    "previous": {
      "href": null
    },
    "self": {
      "href": "https://api.oneflow.com/v1/contracts/10015/events?offset=0&limit=10"
    }
  },
  "count": 1,
  "data": [
    {
      "actor": {
        "id": 1,
        "name": "John",
        "party": {
          "id": 45,
          "name": "Example Company AB"
        }
      },
      "created_time": "2020-10-27T16:45:56+00:00",
      "data": {
        "changes": [],
        "subject": {
          "id": 345
        }
      },
      "id": 12,
      "type": "contract:publish",
      "_links": {
        "contract": {
          "href": "https://api.oneflow.com/v1/contracts/10015"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/10015/events/12"
        }
      }
    },
    {
      "actor": {
        "id": 2,
        "name": "Per",
        "party": {
          "id": 46,
          "name": "Good Company AB"
        }
      },
      "created_time": "2020-10-27T16:45:56+00:00",
      "data": {
        "changes": [],
        "subject": {
          "id": 346
        }
      },
      "id": 13,
      "type": "contract:sign",
      "_links": {
        "contract": {
          "href": "https://api.oneflow.com/v1/contracts/10015"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/10015/events/13"
        }
      }
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns the requested contract events.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Attachment

Upload attachments

/contracts/{contract_id}/files

Use this endpoint to add multiple attachments or a single PDF document to a contract.

POST /contracts/{contract_id}/files


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.

Request body

Request body parameters used for adding multiple attachments or a single PDF document to the specified contract.
Fields marked with * are mandatory, and the top-level attributes are shown in bold.

Expand
NameDescription
file*array[string]
Encoded file data, e.g., the list of files to be uploaded to the contract in binary format. Use @'<file_path>' to convert the file to binary.
maxItems:20
upload_as*string(enum)
The file type of the file to be imported. There are only two types available: attachment and expanded_pdf.

Request body example

--MyFormBoundary
Content-Disposition: form-data; name="upload_as"

attachment
--MyFormBoundary
Content-Disposition: form-data; name="file"; filename="test.txt"

Hello, world!

--MyFormBoundary--

Code example

curl --request POST \
 --url 'https://api.oneflow.com/v1/contracts/CONTRACT_ID/files' \
 --header 'x-oneflow-api-token: API_TOKEN' \
 --header 'x-oneflow-user-email: USER_EMAIL' \
 --header 'Content-Type: multipart/form-data; boundary=----MyFormBoundary' \
 --form 'upload_as="expanded_pdf"' \
 --form '[email protected]"/path/to/file.pdf"'
import requests

data = {'upload_as': 'expanded_pdf'}
files = {'file': open('/path/to/file.pdf','rb')}
headers = {
  'x-oneflow-api-token': 'API_TOKEN', 
  'x-oneflow-user-email': 'USER_EMAIL',
}

response = requests.post('https://api.oneflow.com/v1/contracts/CONTRACT_ID/files', data=data, files=files, headers=headers)

Response codes

StatusMeaningDescription
200OKReturns an empty JSON object.
400Bad RequestInvalid format or content of the request.
404Not FoundA required entity is missing.
409ConflictA conflict occurred with the current state of the target resource.

Get contract files

/contracts/{contract_id}/files/

Use this endpoint to retrieve the list of all files available for the specified contract ID, which includes the contract itself, contract verification, attachments, and PDF documents.

GET /contracts/{contract_id}/files/


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.

Query parameters

NameTypeRequiredDescription
sortstringfalseThe list of columns separated by ',' to sort the results.
offsetintegerfalseminimum: 0, maximum: 19900
limitintegerfalseminimum: 1, maximum: 100

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/contracts/10015/files/ \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/files/"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response with a list containing metadata for files inside a contract:

{
  "_links": {
    "next": {
      "href": "https://api.oneflow.com/v1/contracts/10015/files?offset=4&limit=2"
    },
    "previous": {
      "href": "https://api.oneflow.com/v1/contracts/10015/files?offset=0&limit=2"
    },
    "self": {
      "href": "https://api.oneflow.com/v1/contracts/10015/files?offset=2&limit=2"
    }
  },
  "count": 5,
  "data": [
    {
      "extension": "pdf",
      "id": 1,
      "name": "Contract",
      "type": "contract",
      "_links": {
        "contract": {
          "href": "https://api.oneflow.com/v1/contracts/10015"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/10015/files/1"
        }
      }
    },
    {
      "extension": "pdf",
      "id": 2,
      "name": "Verification",
      "type": "verification",
      "_links": {
        "contract": {
          "href": "https://api.oneflow.com/v1/contracts/10015"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/10015/files/2"
        }
      }
    },
    {
      "extension": "pdf",
      "id": 140245,
      "name": "Meetingnotes",
      "type": "pdf",
      "_links": {
        "contract": {
          "href": "https://api.oneflow.com/v1/contracts/10015"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/10015/files/140245"
        }
      }
    },
    {
      "extension": "pdf",
      "id": 140246,
      "name": "Proposal",
      "type": "pdf",
      "_links": {
        "contract": {
          "href": "https://api.oneflow.com/v1/contracts/10015"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/10015/files/140246"
        }
      }
    },
    {
      "extension": "pdf",
      "id": 140247,
      "name": "Terms and conditions",
      "type": "attachment",
      "_links": {
        "contract": {
          "href": "https://api.oneflow.com/v1/contracts/51874"
        },
        "self": {
          "href": "https://api.oneflow.com/v1/contracts/51874/files/140247"
        }
      }
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns the requested contract files.
400Bad RequestInvalid format or content of the request.
404Not FoundA required entity is missing.
409ConflictA conflict occurred with the current state of the target resource.

Get a contract file by ID

/contracts/{contract_id}/files/{file_id}

Use this endpoint to retrieve a specific contract file by its ID.

GET /contracts/{contract_id}/files/{file_id}


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40

Path parameters

NameTypeDescription
contract_idinteger(id)The unique ID of the contract.
file_idinteger(id)The ID of a file in a contract.

Query parameters

NameTypeRequiredDescription
downloadbooleanfalseIf set to true, the file will be downloaded. The default value is false; in this case, only the file metadata will be returned.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/contracts/10015/files/1 \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675'
import requests

url = "https://api.oneflow.com/v1/contracts/10015/files/1"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response containing metadata for a specific file inside a contract:

{
  "_links": {
    "contract": {
      "href": "https://api.oneflow.com/v1/contracts/10015"
    },
    "self": {
      "href": "https://api.oneflow.com/v1/contracts/10015/files/1"
    }
  },
  "extension": "pdf",
  "id": 1,
  "name": "Contract",
  "type": "contract"
}

Response codes

StatusMeaningDescription
200OKReturns the requested contract file.
302FoundA redirect to the requested contract file.
400Bad RequestInvalid format or content of the request.
404Not FoundA required entity is missing.
409ConflictA conflict occurred with the current state of the target resource.

Workspace

Get workspaces

/workspaces

Use this endpoint to retrieve the list of workspaces available for the specified user.

GET /workspaces


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Query parameters

NameTypeRequiredDescription
sortstringfalseThe list of columns separated by ',' to sort the results.
offsetintegerfalseminimum: 0, maximum: 19900
limitintegerfalseminimum: 1, maximum: 100

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/workspaces \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/workspaces"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response with a list of workspaces:

{
  "_links": {
    "next": {
      "href": "https://api.oneflow.com/v1/workspaces?offset=1&limit=1"
    },
    "previous": {
      "href": null
    },
    "self": {
      "href": "https://api.oneflow.com/v1/workspaces?offset=0&limit=1"
    }
  },
  "count": 2,
  "data": [
    {
      "_links": {
        "self": {
          "href": "https://api.oneflow.com/v1/workspaces/12345"
        }
      },
      "_permissions": {
        "contract:create": true
      },
      "company_name": "My Company AB",
      "country_code": "SE",
      "created_time": "2019-05-16T10:11:48+00:00",
      "date_format": "YYYY-MM-DD",
      "description": "A workspace for holding HR templates.",
      "id": 12345,
      "name": "HR Workspace",
      "registration_number": "11223344-5566",
      "updated_time": "2021-07-22T11:59:11+00:00"
    },
    {
      "_links": {
        "self": {
          "href": "https://api.oneflow.com/v1/workspaces/12346"
        }
      },
      "_permissions": {
        "contract:create": true
      },
      "company_name": "Sale Company AB",
      "country_code": "AL",
      "created_time": "2020-01-05T10:44:42+00:00",
      "date_format": "DD.MM.YYYY",
      "description": "A workspace for holding sales templates.",
      "id": 12346,
      "name": "Sales Workspace",
      "registration_number": "97223234-3457",
      "updated_time": "2020-02-12T13:44:42+00:00"
    }
  ]
}

Response codes

StatusMeaningDescription
200OKReturns the list of workspaces.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
403ForbiddenThe request is not authorized by the server.

Get a workspace by ID

/workspaces/{workspace_id}

Use this endpoint to retrieve a specific workspace by ID.

GET /workspaces/{workspace_id}


Parameters

Request headers

NameTypeRequiredDescription
x-oneflow-api-tokenstringtrueThe API key of your Oneflow account.
minLength: 40, maxLength: 40
x-oneflow-user-emailstring(email)trueThe email address of a registered Oneflow user.

Path parameters

NameTypeDescription
workspace_idinteger(id)The unique ID of the workspace.

Code example

curl --request GET \
  --url https://api.oneflow.com/v1/workspaces/12345 \
  --header 'Accept: application/json' \
  --header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
  --header 'x-oneflow-user-email: [email protected]'
import requests

url = "https://api.oneflow.com/v1/workspaces/12345"

headers = {
    "Accept": "application/json",
    "x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
    "x-oneflow-user-email": "[email protected]"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Response example

A sample response of a workspace:

{
  "_links": {
    "self": {
      "href": "https://api.oneflow.com/v1/workspaces/12345"
    }
  },
  "_permissions": {
    "contract:create": true
  },
  "company_name": "My Company AB",
  "country_code": "SE",
  "created_time": "2019-05-16T10:11:48+00:00",
  "date_format": "YYYY-MM-DD",
  "description": "A workspace for holding HR templates.",
  "id": 12345,
  "name": "HR Workspace",
  "registration_number": "11223344-5566",
  "updated_time": "2021-07-22T11:59:11+00:00"
}

Response codes

StatusMeaningDescription
200OKReturns the requested workspace.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.

Updated about 18 hours ago


Endpoints


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.