Logo
cURL Ruby PHP Python Node.js

Introduction

Getting Started

API Endpoint https://api.documo.com

The Documo API is organized around REST. All calls to the Documo API should be made to https://api.documo.com. All responses are formatted in JSON. This is a required parameter. This is an optional parameter.

You can view code examples in the dark area to the right. You can switch the programming language of the examples using the tabs above.

Enabling API access

To begin using the Documo API, you will need to enable the API and generate an API key. This can be done in by logging into the web app and visiting Settings > API. Visual instructions here.

Authentication

Example of request with API key:

curl -X GET
'https://api.documo.com/ping' \
-H 'Authorization: Basic API_KEY'
import requests

headers = {
    'Authorization': 'Basic API_KEY',
}

requests.GET('https://api.documo.com/ping', headers=headers)
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/ping")
request = Net::HTTP::GET.new(uri)
request["Authorization"] = "Basic API_KEY"

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
<?php
$url = 'https://api.documo.com/ping';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/ping',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Parameter Value
name Authorization
in header
token Basic API_KEY

Most calls will require authentication. Documo supports HTTP authentication. You will need to pass through your secret API key (example shown).

Security note: All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

View my user

Request:

curl -X GET 
'https://api.documo.com/v1/me' \
-H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/me"

headers = {
    'Authorization': "Basic API_KEY",
    }

requests.get(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/me';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/me")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/me',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "emailNotifySendOption": "All",
    "emailNotifyReceiveOption": "All",
    "emailNotifySendIncAttachment": true,
    "emailNotifyReceiveIncAttachment": true,
    "emailToFaxCoverPageOption": false,
    "userId": "7427d2e5-fa42-4820-b612-b7a3132efe30",
    "accountId": "ad39a2c2-d154-4170-83e4-a75fa5466d33",
    "email": "example@mail.com",
    "firstName": "John",
    "lastName": "Doe",
    "userRole": "admin",
    "phone": "18885551234",
    "faxCsid": "mFax",
    "faxCallerId": "12021234567",
    "isEmailConfirmed": true,
    "createdAt": "2017-06-26T10:23:50.000Z",
    "account": {
        "emailNotifySendOption": "Failure",
        "emailNotifyReceiveOption": "Failure",
        "emailNotifySendIncAttachment": "true",
        "emailNotifyReceiveIncAttachment": "true",
        "timezone": "America/Los_Angeles",
        "emailToFax": "false",
        "allowFaxAttachments": "true",
        "usersTokenLife": "14400",
        "uuid": "ad39a2c2-d154-4170-83e4-a75fa5466d33",
        "accountNumber": "2201752731",
        "accountName": "Documo",
        "parentId": null,
        "faxCsid": "mFax",
        "faxCallerId": "12021234567",
    },
    "faxNumbers": []
}

Method: GET

Path: /v1/me

Returns your detailed user data.

API keys

Create API key

Request:

curl -X POST
  'https://api.documo.com/api-keys' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -F 'access=admin' \
  -F 'name=Key Name' \
  -F 'expiresAt=2019-03-31T06:58:27Z' \
  -F 'userId=793bd8e3-60ae-4c90-a6d1-140978a541dd' \
import requests

url = "https://api.documo.com/api-keys"

headers = {
    'Authorization': 'Basic API_KEY',
    'content-type': 'application/x-www-form-urlencoded',
}

data = [
    ('access', 'admin'),
    ('name', 'Key Name'),
    ('expiresAt', '2019-03-31T06:58:27Z'),
    ('userId', '793bd8e3-60ae-4c90-a6d1-140978a541dd'),
]

requests.post(url, headers=headers, data=data)

<?php
$url = 'https://api.documo.com/api-keys';

$body = array(
  'access' => 'admin',
  'name' => 'Key Name',
  'expiresAt' => '2019-03-31T06:58:27Z',
  'userId' => '793bd8e3-60ae-4c90-a6d1-140978a541dd',
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);

require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/api-keys")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "access" => "admin",
  "name" => "Key Name",
  "expiresAt" => "2019-03-31T06:58:27Z",
  "userId" => "793bd8e3-60ae-4c90-a6d1-140978a541dd",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/api-keys',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
          access: 'admin',
          name: 'Key Name',
          expiresAt: '2019-03-31T06:58:27Z',
          userId: '793bd8e3-60ae-4c90-a6d1-140978a541dd',
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "uuid": "ccbfbf52-f58f-4752-97ac-f667c5500000",
    "userId": "793bd8e3-60ae-4c90-a6d1-140978a541dd",
    "name": "POSTMAN",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIyNzg0NjkxOC05OWY1LTQwYzQtYTYxNi02NzAyNjM0YzBiOTQiLCJpYXQiOjE1NTM1ODYwNjN9.bAdykBwX_4LbuC1xbwcCF0mZT2f6PrH7hYCwh2qAgLw",
    "access": "admin",
    "accountId": "12345678-d9a0-493f-a3aa-0cb1114eea0c",
    "expiresAt": "2019-03-31T06:58:27Z",
    "user": {
        "uuid": "27846918-99f5-40c4-a616-6702634c0b95",
        "email": "user@documo.com",
        "firstName": "John",
        "lastName": "Snow",
        "accountId": "12345678-d9a0-493f-a3aa-0cb1114eea0c",
        "avatar": "12adc536-4569-4ad0-b5e0-743b751f775480x80.jpeg",
        "avatarPath": "/path/to/avatar.jpeg",
    }
}

Method: POST

Path: /api-keys

Parameters

Parameter Data Type In Description
access string formData Possible values: admin, base, print_driver
name string formData Key name (128 characters limit)
userId uuid formData User id that will be assigned to key
expiresAt string formData Expire date

Update API key

Request:

curl -X PATCH
  'https://api.documo.com/api-keys/0b2e264c-2972-498b-a709-72a9009e0661' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -F 'access=admin' \
  -F 'name=Key Name' \
  -F 'expiresAt=2019-03-31T06:58:27Z' \
import requests

url = "https://api.documo.com/api-keys/0b2e264c-2972-498b-a709-72a9009e0661"

headers = {
    'Authorization': 'Basic API_KEY',
    'content-type': 'application/x-www-form-urlencoded',
}

data = [
    ('access', 'admin'),
    ('name', 'Key Name'),
    ('expiresAt', '2019-03-31T06:58:27Z'),
]

requests.patch(url, headers=headers, data=data)

<?php
$url = 'https://api.documo.com/api-keys/0b2e264c-2972-498b-a709-72a9009e0661';

$body = array(
  'access' => 'admin',
  'name' => 'Key Name',
  'expiresAt' => '2019-03-31T06:58:27Z',
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_CUSTOMREQUEST => 'PATCH'
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);

require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/api-keys/0b2e264c-2972-498b-a709-72a9009e0661")
request = Net::HTTP::Patch.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "access" => "admin",
  "name" => "Key Name",
  "expiresAt" => "2019-03-31T06:58:27Z",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'PATCH',
    url: 'https://api.documo.com/api-keys/0b2e264c-2972-498b-a709-72a9009e0661',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
          access: 'admin',
          name: 'Key Name',
          expiresAt: '2019-03-31T06:58:27Z',
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "uuid": "0b2e264c-2972-498b-a709-72a9009e0661",
    "name": "Key Name",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIyNzg0NjkxOC05OWY1LTQwYzQtYTYxNi02NzAyNjM0YzBiOTQiLCJpYXQiOjE1NTM1ODM2NDh9._S1et6_0oZ8f88LMIdq3YdwJY0hyz_jyuNN6eoecfjU",
    "expiresAt": "2019-03-31T06:58:27.000Z",
    "access": "admin",
    "accountId": "12345678-d9a0-493f-a3aa-0cb1114eea0c",
    "userId": "87654321-99f5-40c4-a616-6702634c0b94",
    "createdAt": "2019-03-26T07:00:48.000Z",
    "updatedAt": "2019-03-26T09:16:01.000Z",
    "user": {
        "uuid": "27846918-99f5-40c4-a616-6702634c0b95",
        "email": "user@documo.com",
        "firstName": "John",
        "lastName": "Snow",
        "accountId": "12345678-d9a0-493f-a3aa-0cb1114eea0c",
        "avatar": "12adc536-4569-4ad0-b5e0-743b751f775480x80.jpeg",
        "avatarPath": "/path/to/avatar.jpeg",
     }
}

Method: PATCH

Path: /api-keys/{keyId}

Parameters

Parameter Data Type In Description
keyId uuid path Key uuid
access string formData Possible values: admin, base, print_driver
name string formData Key name (128 characters limit)
expiresAt string formData Expire date

Get API keys

Request:

curl -X GET
  'https://api.documo.com/api-keys?userId=27846918-99f5-40c4-a616-6702634c0123' \
  -H 'Authorization: Basic API_KEY' \
import requests

url = "https://api.documo.com/api-keys?userId=27846918-99f5-40c4-a616-6702634c0123"

headers = {'Authorization': 'Basic API_KEY'}

requests.get(url, headers=headers)

<?php
$url = 'https://api.documo.com/api-keys?userId=27846918-99f5-40c4-a616-6702634c0123';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);

require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/api-keys?userId=27846918-99f5-40c4-a616-6702634c0123")
http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/api-keys?userId=27846918-99f5-40c4-a616-6702634c0123',
    headers: {Authorization: 'Basic API_KEY'}
}, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});

Response:

[
    {
        "uuid": "0b2e264c-2972-498b-a709-72a9009e0661",
        "userId": "27846918-99f5-40c4-a616-6702634c0123",
        "name": "Key Name",
        "token": "eyJhbGkiOiKIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIyNzg0NjkxOC05OWY1LTQwYzQtYTYxNi02NzAyNjM0YzBiOTQiLCJpYXQiOjE1NTM1ODM2NDh9._S1et6_0oZ8f88LMIdq3YdwJY0hyz_jyuNN6eoecfjU",
        "createdAt": "2019-03-26T07:00:48.000Z",
        "expiresAt": "2019-03-31T06:58:27.000Z",
        "access": "admin",
        "user": {
            "uuid": "27846918-99f5-40c4-a616-6702634c0123",
            "email": "user@documo.com",
            "firstName": "John",
            "lastName": "Snow",
            "accountId": "12345678-d9a0-493f-a3aa-0cb1114eea0c",
            "avatar": "ddadc536-4569-4ad0-b5e0-743b751f775480x80.jpeg",
            "avatarPath": "path/to/avatar.jpeg",
        }
    },
    ...
]

Method: GET

Path: /api-keys

Parameters

Parameter Data Type In Description
userId uuid query User id

Delete API key

Request:

curl -X DELETE
  'https://api.documo.com/api-keys/0b2e264c-2972-498b-a709-72a9009e0661' \
  -H 'Authorization: Basic API_KEY' \
import requests

url = "https://api.documo.com/api-keys/0b2e264c-2972-498b-a709-72a9009e0661"

headers = {'Authorization': 'Basic API_KEY'}

requests.delete(url, headers=headers)

<?php
$url = 'https://api.documo.com/api-keys/0b2e264c-2972-498b-a709-72a9009e0661';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);

require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/api-keys/0b2e264c-2972-498b-a709-72a9009e0661")
http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/api-keys/0b2e264c-2972-498b-a709-72a9009e0661',
    headers: {Authorization: 'Basic API_KEY'}
}, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});

Response:

Status: 204

Method: DELETE

Path: /api-keys/{keyId}

Parameters

Parameter Data Type In Description
keyId uuid path Key id

Contacts

Get contacts

Request:

curl -X GET \
  'https://api.documo.com/v1/contacts?limit=15&offset=0&query=Organization' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/contacts"

querystring = {"limit":"15","offset":"0","query":"Organization"}

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.get(url, headers=headers, params=querystring)

print(response.text)
<?php
$url = 'https://api.documo.com/v1/contacts';

$query = http_build_query(array(
  'limit' => '15',
  'offset' => '0',
  'query' => 'Organization'
));

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => "{$url}?{$query}",
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/contacts?limit=15&offset=0&query=Organization")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/contacts',
    qs: {
        limit: 15,
        offset: 0,
        order: 'name asc'
    },
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

{
  "count": 1,
  "rows": [
    {
      "uuid": "861660d0-1807-44cb-b68f-c96381a741d6",
      "isOrganization": true,
      "userId": "7b667809-c88f-4a27-b1fe-2cc932401e15",
      "name": "Organization",
      "phoneNumber": "",
      "faxNumber": "",
      "email": "org@com",
      "isPublic": false,
      "publicEditable": false,
      "organizationId": null,
      "contacts": [
        {
          "uuid": "1df1aa6d-0e5e-4a77-8dde-de601e902608",
          "isOrganization": false,
          "userId": "7b667809-c88f-4a27-b1fe-2cc932401e15",
          "name": "Person",
          "phoneNumber": "",
          "faxNumber": "",
          "email": "person@org",
          "isPublic": false,
          "publicEditable": false,
          "organizationId": "861660d0-1807-44cb-b68f-c96381a741d6"
        }
      ]
    }
  ],
  "limit": 15,
  "offset": 0
}

Method: GET

Path: /v1/contacts

Get contacts list by User ID

Parameters

Name Type In Description
userId string query User ID. If not specified - returns results for current user
offset integer query Number of pages to return
limit integer query Amount of line items per page that will be returned
order string query Order results. Ordered by name in ascending order, default value is name asc
query string query Search by contact name, fax number, phone number or email

Create contact

curl -X POST \
  https://api.documo.com/v1/contacts \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'phoneNumber=(201)%20555-0123&faxNumber=(201)%20555-0124&name=John%20Snow&email=john%40snow.com&isPublic=false&publicEditable=false&isOrganization=false'
import requests

headers = {
    'Accept': 'application/json',
    'Authorization': 'Basic API_KEY',
    'Content-Type': 'application/x-www-form-urlencoded',
}

data = [
  ('phoneNumber', '(201) 555-0123'),
  ('faxNumber', '(201) 555-0124'),
  ('name', 'John Snow'),
  ('email', 'john@snow.com'),
  ('isPublic', 'false'),
  ('publicEditable', 'false'),
  ('isOrganization', 'false'),
]

response = requests.post('https://api.documo.com/v1/contacts', headers=headers, data=data)
<?php
$url = 'https://api.documo.com/v1/contacts';

$body = array(
  'phoneNumber' => '(201) 555-0123',
  'faxNumber' => '(201) 555-0124',
  'name' => 'John Snow',
  'email' => 'john@snow.com',
  'isPublic' => 'false',
  'publicEditable' => 'false',
  'isOrganization' => 'false'
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Accept: application/json',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/contacts")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "email" => "john@snow.com",
  "faxNumber" => "(201) 555-0124",
  "isOrganization" => "false",
  "isPublic" => "false",
  "name" => "John Snow",
  "phoneNumber" => "(201) 555-0123",
  "publicEditable" => "false",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/v1/contacts',
    headers: {
        Authorization: 'Basic API_KEY',
        Accept: 'application/json',
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    form: {
        phoneNumber: '(201) 555-0123',
        faxNumber: '(201) 555-0124',
        name: 'John Snow',
        email: 'john@snow.com',
        isPublic: 'false',
        publicEditable: 'false',
        isOrganization: 'false'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

{
  "uuid": "e073d09d-9edd-40b4-ba7a-8a423a52e74a",
  "name": "John Snow",
  "phoneNumber": "(201) 555-0123",
  "faxNumber": "(201) 555-0124",
  "email": "john@snow.com",
  "isPublic": false,
  "publicEditable": false,
  "isOrganization": false,
  "userId": "7b667809-c88f-4a27-b1fe-2cc932401e15"
}

Method: POST

Path: /v1/contacts

Create contact

Parameters

Name Type In Description
userId string query User ID. If not specified - creates contact for current user
name integer formData Contact name
email string formData Contact email
faxNumber integer formData Fax number in format (***) ***-****. Required for sending fax using contact
phoneNumber integer formData Phone number in format (***) ***-****
organizationId string formData Assign contact to existing organization contact
isPublic boolean formData Contact will be shown for all users in the account
isOrganization boolean formData If true - organization will be created
publicEditable boolean formData All account users will be able to edit contact if value is true

Update contact

curl -X PATCH \
  https://api.documo.com/v1/contacts \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'phoneNumber=(201)%20555-0123&faxNumber=(201)%20555-0124&name=John%20Snow&email=john%40snow.com&isPublic=false&publicEditable=false'
import requests

headers = {
    'Accept': 'application/json',
    'Authorization': 'Basic API_KEY',
    'Content-Type': 'application/x-www-form-urlencoded',
}

data = [
  ('phoneNumber', '(201) 555-0123'),
  ('faxNumber', '(201) 555-0124'),
  ('name', 'John Snow'),
  ('email', 'john@snow.com'),
  ('isPublic', 'false'),
  ('publicEditable', 'false'),
]

response = requests.patch('https://api.documo.com/v1/contacts', headers=headers, data=data)
<?php
$url = 'https://api.documo.com/v1/account/ad39a2c2-d154-4170-83e4-a75fa5466d33';

$body = array(
  'companyName' => 'COMPANY',
  'emailNotifySendOption' => 'all',
  'emailNotifyReceiveOption' => 'all',
  'emailNotifySendIncAttachment' => 'true',
  'emailNotifyReceiveIncAttachment' => 'true',
  'timezone' => 'America/Los_Angeles',
  'usersTokenLife' => '14400',
  'emailToFax' => 'true',
  'allowFaxAttachments' => 'true'
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Accept: application/json',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body
  CURLOPT_CUSTOMREQUEST => 'PATCH'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/contacts")
request = Net::HTTP::Patch.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "email" => "john@snow.com",
  "faxNumber" => "(201) 555-0124",
  "isPublic" => "false",
  "name" => "John Snow",
  "phoneNumber" => "(201) 555-0123",
  "publicEditable" => "false",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end
const request = require("request");

request({
    method: 'PATCH',
    url: 'https://api.documo.com/v1/contacts',
    headers: {
        Authorization: 'Basic API_KEY',
        Accept: 'application/json',
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    form: {
        phoneNumber: '(201) 555-0123',
        faxNumber: '(201) 555-0124',
        name: 'John Snow',
        email: 'john@snow.com',
        isPublic: 'false',
        publicEditable: 'false',
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

{
  "uuid": "e073d09d-9edd-40b4-ba7a-8a423a52e74a",
  "name": "John Snow",
  "phoneNumber": "(201) 555-0123",
  "faxNumber": "(201) 555-0124",
  "email": "john@snow.com",
  "isPublic": false,
  "publicEditable": false,
  "isOrganization": false,
  "userId": "7b667809-c88f-4a27-b1fe-2cc932401e15"
}

Method: PATCH

Path: /v1/contacts/{contactId}

Update contact

Parameters

Name Type In Description
contactId string path Contact ID
name integer formData Contact name
email string formData Contact email
faxNumber integer formData Fax number in format (***) ***-****. Required for sending fax using contact
phoneNumber integer formData Phone number in format (***) ***-****
organizationId string formData Assign contact to existing organization contact
isPublic boolean formData Contact will be shown for all users in the account
publicEditable boolean formData All account users will be able to edit contact if value is true

Delete contact

Request:

curl -X DELETE \
  https://api.documo.com/v1/contacts/e073d09d-9edd-40b4-ba7a-8a423a52e74a \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/contacts/e073d09d-9edd-40b4-ba7a-8a423a52e74a"

headers = {
    'Accept': "application/json",
    'Authorization': "Basic API_KEY"
    }

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

print(response.text)
<?php
$url = 'https://api.documo.com/v1/contacts/e073d09d-9edd-40b4-ba7a-8a423a52e74a';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/contacts/e073d09d-9edd-40b4-ba7a-8a423a52e74a")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/v1/contacts/e073d09d-9edd-40b4-ba7a-8a423a52e74a',
    headers: {
        Authorization: 'Basic API_KEY',
        Accept: 'application/json'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

Status: 204

Method: DELETE

Path: /v1/contacts/{contactId}

Delete contact

Parameters

Name Type In Description
contactId string path Contact ID

Bulk delete contacts

Request:

curl -X DELETE \
  'https://api.documo.com/v1/contacts/bulk?contactsIds=861660d0-1807-44cb-b68f-c96381a741d6,1df1aa6d-0e5e-4a77-8dde-de601e902608' \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/contacts/bulk"

querystring = {"contactsIds":"861660d0-1807-44cb-b68f-c96381a741d6,1df1aa6d-0e5e-4a77-8dde-de601e902608"}

headers = {
    'Accept': "application/json",
    'Authorization': "Basic API_KEY"
    }

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

print(response.text)
<?php
$url = 'https://api.documo.com/v1/contacts/bulk';

$query = http_build_query(array(
  'contactsIds' => '861660d0-1807-44cb-b68f-c96381a741d6,1df1aa6d-0e5e-4a77-8dde-de601e902608'
));

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => "{$url}?{$query}",
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/contacts/bulk?contactsIds=861660d0-1807-44cb-b68f-c96381a741d6,1df1aa6d-0e5e-4a77-8dde-de601e902608")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/v1/contacts/bulk',
    qs: {
        contactsIds: '861660d0-1807-44cb-b68f-c96381a741d6,1df1aa6d-0e5e-4a77-8dde-de601e902608'
    },
    headers: {
        Authorization: 'Basic API_KEY',
        Accept: 'application/json'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

Status: 204

Method: DELETE

Path: /v1/contacts/bulk

Bulk delete contacts

Parameters

Name Type In Description
contactIds string query Contact IDs

Fax

Send a fax

Request:

curl -X POST
  'https://api.documo.com/v1/faxes' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: multipart/form-data' \
  -F 'faxNumber=18885551234' \
  -F 'coverPage=true' \
  -F 'recipientName=John' \
  -F 'subject=test' \
  -F 'notes=test' \
  -F 'tags=4c225812-81f1-4827-8194-b0e9475c54e6' \
  -F 'attachments=@/home/user/Documents/Sample.pdf'
import requests

url = "https://api.documo.com/v1/faxes"

headers = {
    'Authorization': 'Basic API_KEY',
}

data = [
  ('faxNumber', '18885551234'),
  ('coverPage', 'true'),
  ('recipientName', 'John'),
  ('subject', 'test'),
  ('notes', 'test'),
  ('tags', '4c225812-81f1-4827-8194-b0e9475c54e6'),
]

attachments = [
    ('file', ('sample.pdf', open('sample.pdf', 'rb'), 'application/pdf'),
]

requests.post(url, headers=headers, data=data, files=attachments)

print(results.text)
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/faxes")
request = Net::HTTP::Post.new(uri)
request.content_type = "multipart/form-data"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "faxNumber" => "18885551234",
  "coverPage" => "true",
  "recipientName" => "John",
  "subject" => "test",
  "notes" => "test",
  "tags" => "4c225812-81f1-4827-8194-b0e9475c54e6",
  "attachments" => "/home/user/Documents/Sample.pdf",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
<?php
$url = 'https://api.documo.com/v1/faxes';

$file = new CURLFile('/home/user/Documents/Sample.pdf', 'application/pdf', 'sample_name');
$body = array(
  'faxNumber' => '18885551234',
  'recipientName' => 'John',
  'coverPage' => 'true',
  'subject' => 'test',
  'notes' => 'test'
  'tags' => '4c225812-81f1-4827-8194-b0e9475c54e6'
  'attachments' => $file
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: multipart/form-data'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
const fs = require("fs");
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/v1/faxes',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'multipart/form-data'
    },
    formData: {
        faxNumber: '18885551234',
        /** Make sure boolean coverPage passed as string, since formData only accepts string or Buffer. */
        coverPage: 'true',
        recipientName: 'John',
        subject: 'test',
        notes: 'test',
        tags: '4c225812-81f1-4827-8194-b0e9475c54e6',
        attachments: {
            value: fs.createReadStream("/home/user/Documents/Sample.pdf"),
            options: {
                filename: '/home/user/Documents/Sample.pdf',
                contentType: 'application/pdf'
            }
        }
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "accountId":"6c838c7c-cb48-4763-84d6-233b5f8cf782",
    "channelType":"web",
    "direction":"outbound",
    "createdAt":"2018-01-01T12:00:00.000Z",
    "deletedAt":null,
    "deliveryId":"2180614133420933276",
    "duration":86318,
    "errorCode":"0",
    "errorInfo":"",
    "faxAttempt":1,
    "faxbridge":null,
    "faxbridgeId":null,
    "faxCallerId":"5094570051",
    "faxCsid":"mFax",
    "faxDetected":true,
    "faxECM":256,
    "faxNumber":"+18885550000",
    "faxProtocol":34,
    "faxSpeed":33600,
    "isArchived":false,
    "isFilePurged":false,
    "messageId":"027012f1-80c9-4be5-b093-1f54783dfa3b",
    "messageNumber":"8900000",
    "pagesComplete":3,
    "pagesCount":3,
    "status":"success",
    "resolvedDate":"2018-01-01T12:00:00.000Z",
    "resultCode":"0",
    "resultInfo": null,
    "contacts":[],
    "tagId": "4c225812-81f1-4827-8194-b0e9475c54e6",
    "tags":[
        {
            "uuid": "4c225812-81f1-4827-8194-b0e9475c54e6",
            "createdBy": "7b667809-c88f-4a27-b1fe-2cc932401e15",
            "name": "Healthcare",
            "color": "1E88E5",
            "isPublic": 1
        }
    ],
    "users":[]
}

Method: POST

Path: /v1/faxes

Use this method to create and send a fax. You may include our default cover page by adding coverPage parameter with a value of true. Files added to the stream will be converted to the body of the fax in the order they are added.

Parameters

Name Type In Description
faxNumber string formData Destination phone number. Country code must be included (ex. 18885551234).
coverPage boolean formData Defaults to false. Indicating true will include system cover page. If coverPage is added, this removes file requirement.
coverPageId string formData uuid of the cover page you want to include. If this param isn’t set but coverPage is true, default cover page for user will be used.
tags string formData Comma separated list of tag IDs (ex. 4c225812-81f1-4827-8194-b0e9475c54e6,7328e171-bc1f-44a6-bc18-df40a4345c9d)
recipientName string formData Will populate in TO field of cover page (40 characters limit)
senderName string formData Will populate in FROM field of cover page (40 characters limit)
subject string formData Will populate Subject field of cover page (55 characters limit)
callerId string formData Phone number. Defaults to user setting if not included in call (10 characters limit)
notes string formData Will populate Notes field of cover page (4000 characters limit)
attachments blob formData File(s) you wish to fax. Add files to the stream in order they should be rendered. At least 1 file is required if coverPage parameter is not added.

Send multiple faxes

Request:

curl -X POST
  'https://api.documo.com/v1/faxes/multiple' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: multipart/form-data' \
  -F 'recipientFax=18885551234' \
  -F 'coverPage=true' \
  -F 'recipientName=John' \
  -F 'subject=test' \
  -F 'notes=test' \
  -F 'tags=b0514cef-92c4-43e1-8c7e-061ee72b0de1'\
  -F 'attachments=@/home/user/Documents/Sample.pdf'
import requests

url = "https://api.documo.com/v1/faxes/multiple"

headers = {
    'Authorization': 'Basic API_KEY',
}

data = [
  ('recipientFax', '18885551234'),
  ('coverPage', 'true'),
  ('recipientName', 'John'),
  ('subject', 'test'),
  ('notes', 'test'),
  ('tags', 'b0514cef-92c4-43e1-8c7e-061ee72b0de1'),
]

attachments = [
    ('file', ('sample.pdf', open('sample.pdf', 'rb'), 'application/pdf'),
]

requests.post(url, headers=headers, data=data, files=attachments)

print(results.text)
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/faxes/multiple")
request = Net::HTTP::Post.new(uri)
request.content_type = "multipart/form-data"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "recipientFax" => "18885551234",
  "coverPage" => "true",
  "recipientName" => "John",
  "subject" => "test",
  "notes" => "test",
  "tags" => "b0514cef-92c4-43e1-8c7e-061ee72b0de1",
  "attachments" => "/home/user/Documents/Sample.pdf",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
<?php
$url = 'https://api.documo.com/v1/faxes/multiple';

$file = new CURLFile('/home/user/Documents/Sample.pdf', 'application/pdf', 'sample_name');
$body = array(
  'recipientFax' => '18885551234',
  'recipientName' => 'John',
  'coverPage' => 'true',
  'subject' => 'test',
  'notes' => 'test'
  'tags' => 'b0514cef-92c4-43e1-8c7e-061ee72b0de1',
  'attachments' => $file
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: multipart/form-data'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
const fs = require("fs");
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/v1/faxes/multiple',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'multipart/form-data'
    },
    formData: {
        recipientFax: '18885551234',
        /** Make sure boolean coverPage passed as string, since formData only accepts string or Buffer. */
        coverPage: 'true',
        recipientName: 'John',
        subject: 'test',
        notes: 'test',
        tags: 'b0514cef-92c4-43e1-8c7e-061ee72b0de1',
        attachments: {
            value: fs.createReadStream("/home/user/Documents/Sample.pdf"),
            options: {
                filename: '/home/user/Documents/Sample.pdf',
                contentType: 'application/pdf'
            }
        }
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "success": [
        {
            "accountId":"6c838c7c-cb48-4763-84d6-233b5f8cf782",
            "channelType":"web",
            "direction":"outbound",
            "createdAt":"2018-01-01T12:00:00.000Z",
            "deletedAt":null,
            "deliveryId":"2180614133420933276",
            "duration":86318,
            "errorCode":"0",
            "errorInfo":"",
            "faxAttempt":1,
            "faxbridge":null,
            "faxbridgeId":null,
            "faxCallerId":"5094570051",
            "faxCsid":"mFax",
            "faxDetected":true,
            "faxECM":256,
            "faxNumber":"+18885550000",
            "faxProtocol":34,
            "faxSpeed":33600,
            "isArchived":false,
            "isFilePurged":false,
            "messageId":"027012f1-80c9-4be5-b093-1f54783dfa3b",
            "messageNumber":"8900000",
            "pagesComplete":3,
            "pagesCount":3,
            "status":"success",
            "resolvedDate":"2018-01-01T12:00:00.000Z",
            "resultCode":"0",
            "resultInfo": null,
            "contacts":[],
            "tags":[],
            "users":[]
        }
    ],
    "errors": [
      // Error message example
      {
        "error" : "InvalidInputError: No files and cover page in to send.",
        "recipientFax" : "12015234232"
      }
    ]
}

Method: POST

Path: /v1/faxes/multiple

Use this method to create and send a fax. You may include our default cover page by adding coverPage parameter with a value of true. Files added to the stream will be converted to the body of the fax in the order they are added.

Multiple recipients: You may add multiple comma separated recipient destinations. This will result in an identical fax being sent to each destination.

Parameters

Name Type In Description
recipientFax string[] formData Destination phone number. Country code must be included (ex. 18885551234). Multiple destinations separated by comma.
recipientContacts string[] formData Contact IDs separated by comma
coverPage boolean formData Defaults to false. Indicating true will include system cover page. If coverPage is added, this removes file requirement.
coverPageId string formData uuid of the cover page you want to include. If this param isn’t set but coverPage is true, default cover page for user will be used.
recipientName string formData Will populate in TO field of cover page (40 characters limit)
senderName string formData Will populate in FROM field of cover page (40 characters limit)
subject string formData Will populate Subject field of cover page (55 characters limit)
callerId string formData Phone number. Defaults to user setting if not included in call (10 characters limit)
notes string formData Will populate Notes field of cover page (4000 characters limit)
tags string formData Comma separated list of tag IDs (ex. 4c225812-81f1-4827-8194-b0e9475c54e6,7328e171-bc1f-44a6-bc18-df40a4345c9d)
attachments blob formData File(s) you wish to fax. Add files to the stream in order they should be rendered. At least 1 file is required if coverPage parameter is not added.

Resend fax

curl -X POST 'https://api.documo.com/v1/fax/resend' \
 -H 'Authorization: Basic API_KEY' \
 -H 'Content-type: application/x-www-form-urlencoded' \
 -d' messageId=027012f1-80c9-4be5-b093-1f54783dfa3b&recipientFax=18885551234'
import requests

url = "https://api.documo.com/v1/fax/resend"

headers = {
    'Authorization': 'Basic API_KEY',
    'Content-type': 'application/x-www-form-urlencoded',
}

data = [
  ('messageId', '027012f1-80c9-4be5-b093-1f54783dfa3b'),
  ('recipientFax', '18885551234'),
]

requests.post(url, headers=headers, data=data)
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/fax/resend")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "messageId" => "027012f1-80c9-4be5-b093-1f54783dfa3b",
  "recipientFax" => "18885551234",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
<?php
$url = 'https://api.documo.com/v1/fax/resend';

$body = array(
  'messageId' => '027012f1-80c9-4be5-b093-1f54783dfa3b',
  'recipientFax' => '18885551234'
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/v1/fax/resend',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
        messageId: '027012f1-80c9-4be5-b093-1f54783dfa3b',
        recipientFax: '18885551234'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
  "success": [
    {
          "accountId":"6c838c7c-cb48-4763-84d6-233b5f8cf782",
          "channelType":"web",
          "direction":"outbound",
          "createdAt":"2018-01-01T12:00:00.000Z",
          "deletedAt":null,
          "deliveryId":"2180614133420933276",
          "duration":86318,
          "errorCode":"0",
          "errorInfo":"",
          "faxAttempt":1,
          "faxbridgeId":210000000000,
          "faxCallerId":"5094570051",
          "faxCsid":"mFax",
          "faxDetected":true,
          "faxECM":256,
          "faxNumber":"+18885550000",
          "faxProtocol":34,
          "faxSpeed":33600,
          "isArchived":false,
          "isFilePurged":false,
          "messageId":"027012f1-80c9-4be5-b093-1f54783dfa3b",
          "messageNumber":"8900000",
          "pagesComplete":3,
          "pagesCount":3,
          "status":"success",
          "resolvedDate":"2018-01-01T12:00:00.000Z",
          "resultCode":"0",
          "resultInfo": null,
          "contacts":[],
          "tags":[],
          "users":[],
          "faxbridge": {
            "deviceCode": "210000000000",
            "name": "FaxBridge",
            "isActive": true
          },
    }
  ],
  "errors": []
}

Method: POST

Path: /v1/fax/resend

This call will resend a previously attempted fax. Simply supply the messageId of previous fax and we will resend.

Parameters

Name Type In Description
messageId string formData Unique message identifier provided by Documo
recipientFax string formData Use this parameter to change destination phone number.

Update fax

curl -X PATCH 'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b' \
 -H 'Authorization: Basic API_KEY' \
 -H 'Content-type: application/x-www-form-urlencoded' \
 -d' isArchived=true'
import requests

url = "https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b"

headers = {
    'Authorization': 'Basic API_KEY',
    'Content-type': 'application/x-www-form-urlencoded',
}

data = [
  ('isArchived', 'true'),
]

requests.patch(url, headers=headers, data=data)
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b")
request = Net::HTTP::Patch.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "isArchived" => "18885551234",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
<?php
$url = 'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b';

$body = array(
  'isArchived' => 'true'
);

$headers = array(
  'Authorization: Basic API_KEY',
  'content-type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body,
  CURLOPT_CUSTOMREQUEST => 'PATCH'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
const request = require("request");

request({
    method: 'PATCH',
    url: 'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
        isArchived: true,
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
      "accountId":"6c838c7c-cb48-4763-84d6-233b5f8cf782",
      "channelType":"web",
      "direction":"outbound",
      "createdAt":"2018-01-01T12:00:00.000Z",
      "deletedAt":null,
      "deliveryId":"2180614133420933276",
      "duration":86318,
      "errorCode":"0",
      "errorInfo":"",
      "faxAttempt":1,
      "faxbridgeId":210000000000,
      "faxCallerId":"5094570051",
      "faxCsid":"mFax",
      "faxDetected":true,
      "faxECM":256,
      "faxNumber":"+18885550000",
      "faxProtocol":34,
      "faxSpeed":33600,
      "isArchived":false,
      "isFilePurged":false,
      "isRead":false,
      "messageId":"027012f1-80c9-4be5-b093-1f54783dfa3b",
      "messageNumber":"8900000",
      "pagesComplete":3,
      "pagesCount":3,
      "status":"success",
      "resolvedDate":"2018-01-01T12:00:00.000Z",
      "resultCode":"0",
      "contacts":[]
      "tags":[],
      "users":[],
      "faxbridge": {
        "deviceCode": "210000000000",
        "name": "FaxBridge",
        "isActive": true
      },
}

Method: PATCH

Path: /v1/fax/${messageId}

This method updated fax properties, currently only isArchived property available for editing.

Parameters

Name Type In Description
isArchived boolean formData Use this parameter to change archived status of fax.

Fax download

Request:

curl -X GET
'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b/download' \
-H 'Accept: application/json' \
-H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b/download"

headers = {
    'Accept': 'application/json',
    'Authorization': 'Basic API_KEY',
}

requests.get(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b/download';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => "{$url}",
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b/download")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b/download',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

Content-Disposition: attachment; filename="Sample.pdf"
Content-Length: 53248
Content-Type: application/pdf

Method: GET

Path: /v1/fax/${messageId}/download

Method will return PDF download of requested fax.

Parameters

Name Type In Description
messageId string path Unique message identifier provided by Documo

Fax history

Request:

curl -X GET
'https://api.documo.com/v1/fax/history?offset=0&limit=20&direction=all&status=all&include=tags,contacts' \
-H 'Accept: application/json' \
-H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/fax/history"

headers = {
    'Accept': 'application/json',
    'Authorization': 'Basic API_KEY',
}

params = (
    ('offset', '0'),
    ('limit', '20'),
    ('direction', 'all'),
    ('status', 'all'),
    ('include', 'tags,contacts'),
    ('query', '')
)

requests.get(url, headers=headers, params=params)
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/fax/history")
request = Net::HTTP::Get.new(uri)
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "offset" => "0",
  "limit" => "20",
  "direction" => "all",
  "status" => "all",
  "include" => "tags,contacts",
  "query" => ""
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
<?php
$url = 'https://api.documo.com/v1/fax/history';

$query = http_build_query(array(
  'offset' => '0',
  'limit' => '20',
  'direction' => 'all',
  'status' => 'all',
  'include' => 'tags,contacts',
  'query' => ''
));

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/json'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => "{$url}?{$query}",
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/fax/history',
    qs: {
        offset: '0',
        limit: '20',
        direction: 'all',
        status: 'all',
        query: '',
        include: 'tags,contacts'
    },
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
  "rows": [
    {
      "accountId":"6c838c7c-cb48-4763-84d6-233b5f8cf782",
      "channelType":"web",
      "direction":"outbound",
      "createdAt":"2018-01-01T12:00:00.000Z",
      "deletedAt":null,
      "deliveryId":"2180614133420933276",
      "duration":86318,
      "errorCode":"0",
      "errorInfo":"",
      "faxAttempt":1,
      "faxbridge":null,
      "faxbridgeId":null,
      "faxCallerId":"5094570051",
      "faxCsid":"mFax",
      "faxDetected":true,
      "faxECM":256,
      "faxNumber":"+18885550000",
      "faxProtocol":34,
      "faxSpeed":33600,
      "isArchived":false,
      "isFilePurged":false,
      "isRead":false,
      "messageId":"027012f1-80c9-4be5-b093-1f54783dfa3b",
      "messageNumber":"8900000",
      "pagesComplete":3,
      "pagesCount":3,
      "status":"success",
      "resolvedDate":"2018-01-01T12:00:00.000Z",
      "resultCode":"0",
      "contacts":[],
      "tags":[],
      "users":[]
    },
    ...
  ],
  "limit": 0,
  "offset": 20
}

Method: GET

Path: /v1/fax/history

Returns detailed fax history as line items. Response is paged.

Parameters

Name Type In Description
offset integer query Number of pages to return
limit integer query Amount of records per page that will be returned. Maximum 500 per call.
direction string query Filters results by direction. Can indicate all (default), inbound or outbound
status string query Filters results by status. Can indicate all (default), failed, success, or processing
fromDate date query Filters results from starting date by createdAt field. (ex. 2012-04-23)
toDate date query Filters results up to end date by createdAt field. (ex. 2012-04-23)
userId string query Filters results by User ID
accountId string query Filters results by Account ID
query string query Search by CSID, Caller ID, fax number and message id.
tags string formData Comma separated list of tag IDs (ex. 4c225812-81f1-4827-8194-b0e9475c54e6,7328e171-bc1f-44a6-bc18-df40a4345c9d)
isArchived boolean query Filters by archived faxes if true
include string[] query Include assigned contacts or tags. Example: tags,contacts

Fax info

Request:

curl -X GET
  'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b/info' \
  -H 'Authorization: Basic API_KEY'
<?php
$url = 'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b/info';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b/info")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b/info"

headers = {
    'Authorization': 'Basic API_KEY'
}

requests.get(url, headers=headers)
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b/info',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
  "accountId":"00000000-0000-0000-0000-000000000000",
  "channelType":"web",
  "direction":"outbound",
  "createdAt":"2018-01-01T12:00:00.000Z",
  "deletedAt":null,
  "deliveryId":"2180614133420933276",
  "duration":86318,
  "errorCode":"0",
  "errorInfo":"",
  "faxAttempt":1,
  "faxbridgeId":null,
  "faxCallerId":"5094570051",
  "faxCsid":"mFax",
  "faxDetected":true,
  "faxECM":256,
  "faxNumber":"+18885550000",
  "faxProtocol":34,
  "faxSpeed":33600,
  "isArchived":false,
  "isFilePurged":false,
  "messageId":"027012f1-80c9-4be5-b093-1f54783dfa3b",
  "messageNumber":"8900000",
  "pagesComplete":3,
  "pagesCount":3,
  "status":"success",
  "resolvedDate":"2018-01-01T12:00:00.000Z",
  "resultCode":"0",
  "resultInfo": null,
  "contacts":[],
  "tags":[],
  "faxbridge": {
    "deviceCode": "210000000000",
    "name": "FaxBridge",
    "isActive": true
  },
  "users": [
    {
      "userId": "7b667809-c88f-4a27-b1fe-2cc932401e15",
      "firstName": "John",
      "lastName": "Snow",
      "email": "john@snow.com"
    }
  ],
  "account": {
    "uuid": "6c838c7c-cb48-4763-84d6-233b5f8cf782",
    "supportCode": "1201800000",
    "companyName": "Winterfell"
  }
}

Method: GET

Path: /v1/fax/{messageId}/info

Returns fax info.

Parameters

Name Type In Description
messageId string path Unique message identifier provided by Documo

Fax delete

Request:

curl -X DELETE
  'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b' \
  -H 'Authorization: Basic API_KEY'
<?php
$url = 'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b"

headers = {
    'Authorization': 'Basic API_KEY'
}

requests.delete(url, headers=headers)
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/v1/fax/027012f1-80c9-4be5-b093-1f54783dfa3b',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

Status: 200

Method: DELETE

Path: /v1/fax/{messageId}

Removes fax.

Parameters

Name Type In Description
messageId string path Unique message identifier provided by Documo

Get CoverPages

Request:

curl -X GET
  'https://api.documo.com/coverpages' \
  -H 'Authorization: Basic API_KEY'
<?php
$url = 'https://api.documo.com/coverpages';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'GET'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/coverpages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.documo.com/coverpages"

headers = {
    'Authorization': 'Basic API_KEY'
}

requests.get(url, headers=headers)
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/coverpages',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

[
    {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "name": "Default",
        "template": "<h1>Fax Transmission</h1>\n<p>&nbsp;</p>\n<table style=\"height: 54px; width: 100%;\" width=\"100%\">\n<tbody>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px;\" width=\"50%\"><strong>To:</strong> ${tokens.recipientName}</td>\n<td style=\"height: 18px;\" width=\"50%\"><strong>From:</strong> ${tokens.senderName}</td>\n</tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px;\" width=\"50%\"><strong>Fax: </strong>${tokens.recipientFax}</td>\n<td style=\"height: 18px;\" width=\"50%\"><strong>Fax: </strong>${tokens.callerId}</td>\n</tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px;\" width=\"50%\"><strong>RE:</strong> ${tokens.subject}</td>\n<td style=\"height: 18px;\" width=\"50%\"><strong>Date:</strong>&nbsp;${tokens.date}</td>\n</tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px;\" width=\"50%\"><strong>Pages:</strong> ${tokens.pages}</td>\n</tr>\n</tbody>\n</table>\n<hr style=\"border: 1px solid #000;\" />\n<p><strong>Comments:</strong> ${tokens.notes}</p>",
        "accountId": null,
        "userId": null,
        "isPublic": true,
        "previewLink": "https://storage.googleapis.com/documo-storage/coverpages/00000000-0000-0000-0000-000000000000.png"
    },
    ...
]

Method: GET

Path: /coverpages

Use this method to fetch all available coverpages.

Tags

Get tags

Request:

curl -X GET \
  'https://api.documo.com/v1/tags' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/tags"

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.get(url, headers=headers)

print(response.text)
<?php
$url = 'https://api.documo.com/v1/tags';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/tags")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/tags',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

[
  {
    "uuid": "4c225812-81f1-4827-8194-b0e9475c54e6",
    "createdBy": "7b667809-c88f-4a27-b1fe-2cc932401e15",
    "name": "Healthcare",
    "color": "1E88E5",
    "isPublic": 1
  },
  {
    "uuid": "67ad1d52-c253-4441-a289-6ab8a124cc23",
    "createdBy": "7b667809-c88f-4a27-b1fe-2cc932401e15",
    "name": "Confidential",
    "color": "E91E63",
    "isPublic": 1
  }
]

Method: GET

Path: /v1/tags

Get tags list

Create tag

curl -X POST \
  https://api.documo.com/v1/tag \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'name=Documentation&color=ff0000&isPublic=true'
import requests

headers = {
    'Accept': 'application/json',
    'Authorization': 'Basic API_KEY',
    'Content-Type': 'application/x-www-form-urlencoded',
}

data = [
  ('name', 'Documentation'),
  ('color', 'ff0000'),
  ('isPublic', 'true'),
]

response = requests.post('https://api.documo.com/v1/tag', headers=headers, data=data)
<?php
$url = 'https://api.documo.com/v1/tag';

$body = array(
  'name' => 'Documentation',
  'color' => 'ff0000',
  'isPublic' => 'true'
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/tag")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "color" => "ff0000",
  "isPublic" => "true",
  "name" => "Documentation",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/v1/tag',
    headers: {
        Authorization: 'Basic API_KEY',
        Accept: 'application/json',
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    form: {
        name: 'Documentation',
        color: 'ff0000',
        isPublic: 'true'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

{
  "uuid": "b0514cef-92c4-43e1-8c7e-061ee72b0de1",
  "name": "Documentation",
  "color": "ff0000",
  "createdBy": "7b667809-c88f-4a27-b1fe-2cc932401e15",
  "isPublic": true
}

Method: POST

Path: /v1/tag

Create tag

Parameters

Name Type In Description
name integer formData Tag name (32 characters limit)
color string formData Tag color hex (7 characters limit with # character)
isPublic boolean formData Tag will be shown for all users in the account

Delete tag

Request:

curl -X DELETE \
  https://api.documo.com/v1/tag/b0514cef-92c4-43e1-8c7e-061ee72b0de1 \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/tag/b0514cef-92c4-43e1-8c7e-061ee72b0de1"

headers = {
    'Accept': "application/json",
    'Authorization': "Basic API_KEY"
    }

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

print(response.text)
<?php
$url = 'https://api.documo.com/v1/tag/b0514cef-92c4-43e1-8c7e-061ee72b0de1';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/tag/b0514cef-92c4-43e1-8c7e-061ee72b0de1")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/v1/tag/b0514cef-92c4-43e1-8c7e-061ee72b0de1',
    headers: {
        Authorization: 'Basic API_KEY',
        Accept: 'application/json'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

Status: 204

Method: DELETE

Path: /v1/tag/{uuid}

Delete tag

Parameters

Name Type In Description
uuid string path Tag ID

Get fax tags

Request:

curl -X GET \
  'https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tags' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tags"

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.get(url, headers=headers)

print(response.text)
<?php
$url = 'https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tags';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tags")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tags',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

[
  {
    "uuid": "4c225812-81f1-4827-8194-b0e9475c54e6",
    "createdBy": "7b667809-c88f-4a27-b1fe-2cc932401e15",
    "name": "Healthcare",
    "color": "1E88E5",
    "isPublic": 1
  }
]

Method: GET

Path: /v1/fax/{messageId}/tags

Get tags list by Message ID

Parameters

Name Type In Description
messageId string path Unique message identifier provided by Documo

Assign tag to fax

curl -X POST \
  https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tag \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d uuid=b0514cef-92c4-43e1-8c7e-061ee72b0de1
import requests

headers = {
    'Accept': 'application/json',
    'Authorization': 'Basic API_KEY',
    'Content-Type': 'application/x-www-form-urlencoded',
}

data = [
  ('uuid', 'b0514cef-92c4-43e1-8c7e-061ee72b0de1')
]

response = requests.post('https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tag', headers=headers, data=data)
<?php
$url = 'https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tag';

$body = array(
  'uuid' => 'b0514cef-92c4-43e1-8c7e-061ee72b0de1',
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tag")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "uuid" => "b0514cef-92c4-43e1-8c7e-061ee72b0de1",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tag',
    headers: {
        Authorization: 'Basic API_KEY',
        Accept: 'application/json',
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    form: {
        uuid: 'b0514cef-92c4-43e1-8c7e-061ee72b0de1'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

Status: 200

Method: POST

Path: /v1/fax/{messageId}/tag

Assign tag to fax

Parameters

Name Type In Description
messageId string formData Unique message identifier provided by Documo
tagId string formData Tag ID

Unassign tag from fax

Request:

curl -X DELETE \
  https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tag/b0514cef-92c4-43e1-8c7e-061ee72b0de1 \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tag/b0514cef-92c4-43e1-8c7e-061ee72b0de1"

headers = {
    'Accept': "application/json",
    'Authorization': "Basic API_KEY"
    }

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

print(response.text)
<?php
$url = 'https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tag/b0514cef-92c4-43e1-8c7e-061ee72b0de1';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tag/b0514cef-92c4-43e1-8c7e-061ee72b0de1")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/v1/fax/00286047-b9e7-46d7-8cf5-df1bc0f94463/tag/b0514cef-92c4-43e1-8c7e-061ee72b0de1',
    headers: {
        Authorization: 'Basic API_KEY',
        Accept: 'application/json'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

Status: 204

Method: DELETE

Path: /v1/fax/{messageId}/tag/{tagId}

Unassign tag from fax

Parameters

Name Type In Description
messageId string path Unique message identifier provided by Documo
tagId string path Tag ID

Users

Create a user

Request:

curl -X POST
  'https://api.documo.com/v1/users' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -F 'firstName=John' \
  -F 'lastName=Doe' \
  -F 'email=example@mail.com' \
  -F 'phone=18885551234' \
  -F 'password=Passw0rd' \
  -F 'userRole=user'
import requests

url = "https://api.documo.com/v1/users"

headers = {
    'Authorization': 'Basic API_KEY',
    'content-type': 'application/x-www-form-urlencoded',
}

data = [
    ('accountId', '12345678-abcd-1234-5678-abcdfg123456'),
    ('firstName', 'John'),
    ('lastName', 'Doe'),
    ('email', 'example@mail.com'),
    ('phone', '18885551234'),
    ('password', 'Passw0rd'),
    ('userRole', 'user'),
]

requests.post(url, headers=headers, data=data)

<?php
$url = 'https://api.documo.com/v1/users';

$body = array(
  'accountId' => '12345678-abcd-1234-5678-abcdfg123456',
  'firstName' => 'John',
  'lastName' => 'Doe',
  'email' => 'example@mail.com',
  'phone' => '18885551234',
  'password' => 'Passw0rd',
  'userRole' => 'user'
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);

require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/users")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "accountId" => "12345678-abcd-1234-5678-abcdfg123456",
  "firstName" => "John",
  "lastName" => "Doe",
  "email" => "example@mail.com",
  "phone" => "18885551234",
  "password" => "Passw0rd",
  "userRole" => "user",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/v1/users',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
        accountId: '12345678-abcd-1234-5678-abcdfg123456',
        firstName: 'John',
        lastName: 'Doe',
        email: 'example@mail.com',
        phone: '18885551234',
        password: 'Passw0rd',
        userRole: 'user'
    }
}, function(error, response, body) {
    console.log(body);
});

Note that userRole = user is default. Another option is to set user role to admin.

accountId param is optional. If it is not set, user will be assigned to your current account.

Response:

{
  "uuid": "6c838c7c-cb48-4763-84d6-233b5f8cf782",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "avatarUrl": "https://api.documo.com/public/avatars/ddadc536-4569-4ad0-b510-743b751f775480x80.jpeg",
  "email": "john@snow.com",
  "emailNotifySendOption": "all",
  "emailNotifyReceiveOption": "all",
  "emailNotifySendIncAttachment": true,
  "emailNotifyReceiveIncAttachment": true,
  "emailNotifyEmailToFaxQueued": true,
  "faxCsid": "mFax",
  "faxCallerId": "12021234567",
  "faxDefaultCoverPage": "35fb8cc3-064b-4182-943a-76bf7e64725a",
  "firstName": "Jon",
  "lastName": "Snow",
  "isEmailConfirmed": true,
  "ownedBy": "00000000-0000-0000-0000-000000000000",
  "phone": "(201) 555-1234",
  "createdAt": "2017-07-05T08:39:59.000Z",
  "updated_at": "2018-09-04T17:13:05.747Z",
  "userRole": "user",
  "account": {

  }
}

Method: POST

Path: /v1/users

Creates a user for account that is specified in path.

Parameters

Name Type In Description
firstName string formData First name on the card (100 characters limit)
lastName string formData Last name on the card (100 characters limit)
password string formData User password (128 characters limit)
userRole string formData User role
accountId string formData Account ID
phone string formData User phone

Delete user

Request:

curl -X DELETE
  'https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de"

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.delete(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

Status: 200
Message: OK

Method: DELETE

Path: /v1/users/{userId}

Deletes user and unassign all fax numbers.

Parameters

Parameter Data Type In Description
userId string path User ID

Get one user

Request:

curl -X GET
  'https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de"

headers = {
    'Authorization': 'Basic API_KEY'
}

requests.get(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
  "uuid": "6c838c7c-cb48-4763-84d6-233b5f8cf782",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "avatarUrl": "https://api.documo.com/public/avatars/ddadc536-4569-4ad0-b510-743b751f775480x80.jpeg",
  "email": "john@snow.com",
  "emailNotifySendOption": "all",
  "emailNotifyReceiveOption": "all",
  "emailNotifySendIncAttachment": true,
  "emailNotifyReceiveIncAttachment": true,
  "emailNotifyEmailToFaxQueued": true,
  "faxCsid": "mFax",
  "faxCallerId": "12021234567",
  "faxDefaultCoverPage": "35fb8cc3-064b-4182-943a-76bf7e64725a",
  "firstName": "Jon",
  "lastName": "Snow",
  "isEmailConfirmed": true,
  "ownedBy": "00000000-0000-0000-0000-000000000000",
  "phone": "(201) 555-1234",
  "createdAt": "2017-07-05T08:39:59.000Z",
  "updated_at": "2018-09-04T17:13:05.747Z",
  "userRole": "user",
  "account": {

  }
}

Method: GET

Path: /v1/users/{userId}

Get user by ID.

Parameters

Name Type In Description
userId string path User ID

Get users

Request:

curl -X GET
  'https://api.documo.com/v1/users?accountId=fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de&offset=0&limit=10' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/users"

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.get(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/users';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require('request');

request({
    url: 'https://api.documo.com/v1/users',
    headers: {
        Accept: 'application/json',
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "count": 10,
    "rows": [
      {
        "uuid": "6c838c7c-cb48-4763-84d6-233b5f8cf782",
        "accountId": "00000000-0000-0000-0000-000000000000",
        "avatarUrl": "https://api.documo.com/public/avatars/ddadc536-4569-4ad0-b510-743b751f775480x80.jpeg",
        "email": "john@snow.com",
        "emailNotifySendOption": "all",
        "emailNotifyReceiveOption": "all",
        "emailNotifySendIncAttachment": true,
        "emailNotifyReceiveIncAttachment": true,
        "emailNotifyEmailToFaxQueued": true,
        "faxCsid": "mFax",
        "faxCallerId": "12021234567",
        "faxDefaultCoverPage": "35fb8cc3-064b-4182-943a-76bf7e64725a",
        "firstName": "Jon",
        "lastName": "Snow",
        "isEmailConfirmed": true,
        "ownedBy": "00000000-0000-0000-0000-000000000000",
        "phone": "(201) 555-1234",
        "createdAt": "2017-07-05T08:39:59.000Z",
        "updated_at": "2018-09-04T17:13:05.747Z",
        "userRole": "user",
        "account": {
            ...
        },
      },
      ...
    ]
}

Method: GET

Path: /v1/users

Get all users for account that is specified in path.

Parameters

Name Type In Description
accountId string path Account’s UUID
limit number query Amount of line items per page that will be returned
offset number query Number of pages to return (used for pagination)
query string query Search by email, first name, last name, phone, fax_csid and fax_caller_id
order string query Result order. Available values: email first_name last_name users_count last_login_date + asc desc. E.g: email asc

Update user

Request:

curl -X PATCH
'https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de'  \
-H 'Content-Type: application/x-www-form-urlencoded'  \
-H 'Accept: application/json' \
-H 'Authorization: Basic API_KEY'  \
-d 'firstName=John' \
-d 'lastName=Doe' \
-d 'phone=12021234567' \
-d 'faxCallerId=12021234567' \
-d 'faxCsid=mFax' \
-d 'emailNotifySendOption=all' \
-d 'emailNotifyReceiveOption=all' \
-d 'emailNotifySendIncAttachment=true' \
-d 'emailNotifyReceiveIncAttachment=true' \
-d 'emailToFaxCoverPageOption=true'
import requests

url = "https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de"

headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Accept': 'application/json',
    'Authorization': 'Basic API_KEY',
}

data = [
  ('firstName', 'John'),
  ('lastName', 'Doe'),
  ('phone', '12021234567'),
  ('faxCallerId', '12021234567'),
  ('faxCsid', 'mFax'),
  ('emailNotifySendOption', 'all'),
  ('emailNotifyReceiveOption', 'all'),
  ('emailNotifySendIncAttachment', 'true'),
  ('emailNotifyReceiveIncAttachment', 'true'),
  ('emailToFaxCoverPageOption', 'true'),
]

requests.post(url, headers=headers, data=data)
<?php
$url = 'https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de';

$body = array(
  'firstName' => 'John',
  'lastName' => 'Doe',
  'phone' => '18885551234',
  'faxCallerId' => '12021234567',
  'faxCsid' => 'mFax',
  'emailNotifySendOption' => 'All',
  'emailNotifyReceiveOption' => 'All',
  'emailNotifySendIncAttachment' => 'true',
  'emailNotifyReceiveIncAttachment' => 'true'
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Accept: application/json',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body
  CURLOPT_CUSTOMREQUEST => 'PATCH'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de")
request = Net::HTTP::Patch.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "firstName" => "John",
  "lastName" => "Doe",
  "phone" => "12021234567",
  "faxCallerId" => "12021234567",
  "faxCsid" => "mFax",
  "emailNotifySendOption" => "all",
  "emailNotifyReceiveOption" => "all",
  "emailNotifySendIncAttachment" => "true",
  "emailNotifyReceiveIncAttachment" => "true",
  "emailToFaxCoverPageOption" => "true",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'PATCH',
    url: 'https://api.documo.com/v1/users/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
        firstName: 'John',
        lastName: 'Doe',
        phone: '18885551234',
        faxCallerId: '12021234567',
        faxCsid: 'mFax',
        emailNotifySendOption: 'All',
        emailNotifyReceiveOption: 'All',
        emailNotifySendIncAttachment: true,
        emailNotifyReceiveIncAttachment: true
    }
}, function(error, response, body) {
    console.log(body);
});

Response

{
  "emailNotifySendOption": "All",
  "emailNotifyReceiveOption": "All",
  "emailNotifySendIncAttachment": true,
  "emailNotifyReceiveIncAttachment": true,
  "emailToFaxCoverPageOption": true,
  "userId": "fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de",
  "accountId": "6c838c7c-cb48-4763-84d6-233b5f8cf782",
  "email": "example@mail.com",
  "firstName": "John",
  "lastName": "Doe",
  "userRole": "user",
  "phone": "12021234567",
  "faxCsid": "mFax",
  "faxCallerId": "12021234567",
  "isEmailConfirmed": true,
  "createdAt": "2017-06-06T11:23:11.000Z"
}

Method: PATCH

Path: /v1/users/{userId}

Updates user info and settings by user ID.

Parameters

Name Type In Description
userId string path User ID
firstName string formData First name on the card (100 characters limit)
lastName string formData Last name on the card (100 characters limit)
phone string formData User phone
faxCallerId string formData ID of fax caller (10 characters limit)
faxCsid string formData Unique fax ID (20 characters limit)
emailNotifySendOption string formData Outbound fax notification settings. Acceptable values: None, All (default), Success, Failure
emailNotifyReceiveOption string formData Inbound fax notification settings. Acceptable values: None, All (default), Success, Failure
emailNotifySendIncAttachment boolean formData Outbound fax notification attachment settings. Acceptable values: true (default), false
emailNotifyReceiveIncAttachment boolean formData Inbound fax notification attachment settings. Acceptable values: true (default), false
emailToFaxCoverPageOption boolean formData Email to Fax cover page option

Admin

Next sections contain calls accessible by admin level users only.

Account

Create account

Request:

curl -X POST
  'https://api.documo.com/v1/accounts' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -F 'accountName=Night’s Watch' \
  -F 'faxCsid=mFax' \
  -F 'faxCallerId=12021234567'
import requests

url = "https://api.documo.com/v1/accounts"

headers = {
    'Authorization': 'Basic API_KEY',
    'content-type': 'application/x-www-form-urlencoded',
}

data = [
    ('accountName', 'Night’s Watch'),
    ('faxCsid', 'mFax'),
    ('faxCallerId', '12021234567'),
]

requests.post(url, headers=headers, data=data)

<?php
$url = 'https://api.documo.com/v1/accounts';

$body = array(
  'accountName' => 'Night’s Watch',
  'faxCsid' => 'mFax',
  'faxCallerId' => '12021234567'
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);

require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/accounts")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "accountName" => "Night’s Watch",
  "faxCsid" => "mFax",
  "faxCallerId" => "12021234567",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/v1/users',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
        accountName: 'Night’s Watch',
        faxCsid: "mFax",
        faxCallerId: "12021234567",
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "uuid": "00000000-0000-0000-0000-000000000000",
    "accountName": "Night’s Watch",
    "accountNumber": "1201700000",
    "accountType": "customer",
    "allowAdmin": "inherit",
    "allowApi": "inherit",
    "allowEnterprise": "inherit",
    "allowAdminNumbersProvision": "allow",
    "allowAdminNumbersReleasing": "allow",
    "allowEmailToFax": true,
    "allowFaxAttachments": true,
    "allowNumbersForwarding": "allow",
    "allowNumbersManaging": "allow",
    "allowNumbersPorting": "deny",
    "allowUsersManaging": "allow",
    "timezone": "America/Los_Angeles",
    "emailNotifySendOption": "all",
    "emailNotifyReceiveOption": "all",
    "emailNotifySendIncAttachment": true,
    "emailNotifyReceiveIncAttachment": true,
    "emailNotifyEmailToFaxQueued": true,
    "faxCsid": "mFax",
    "faxCallerId": "12021234567",
    "faxDefaultCoverPage": "35fb8cc3-064b-4182-943a-76bf7e64725a",
    "faxLifetime": "31622400",
    "parentId": "35fb8cc3-064b-4182-943a-76bf7e64725a",
    "portingNotificationEmails": ["john@snow.com"],
    "createdAt": "2017-07-05T08:28:14.000Z",
    "updatedAt": "2018-09-04T16:41:14.000Z",
    "childrenCount": 1,
    "usersCount": 17
}

Method: POST

Path: /v1/accounts

Creates subaccount or department for current user’s account.

Parameters

Name Type In Description
accountName string formData Account name
faxCallerId string formData ID of fax caller (10 characters limit)
faxCsid string formData Unique fax ID (20 characters limit)
emailNotifySendOption string formData Outbound fax notification settings. Acceptable values: None, All (default), Success, Failure
emailNotifyReceiveOption string formData Inbound fax notification settings. Acceptable values: None, All (default), Success, Failure
emailNotifySendIncAttachment boolean formData Outbound fax notification attachment settings. Acceptable values: true (default), false
emailNotifyReceiveIncAttachment boolean formData Inbound fax notification attachment settings. Acceptable values: true (default), false
timezone string formData Timezone
allowEmailToFax boolean formData Email to Fax
usersTokenLife integer formData Set manual user token time for this account

Get accounts

Request:

curl -X GET 'https://api.documo.com/v1/accounts' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/accounts"

headers = {'Authorization': 'Basic API_KEY'}

requests.get(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/accounts';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/accounts")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/accounts',
    headers: {Authorization: 'Basic API_KEY'}
}, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});

Response:

{
  "count": 1,
  "rows": [
    {
      "account": {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "accountName": "Night’s Watch",
        "accountNumber": "1201700000",
        "accountType": "customer",
        "allowAdmin": "inherit",
        "allowApi": "inherit",
        "allowEnterprise": "inherit",
        "allowAdminNumbersProvision": "allow",
        "allowAdminNumbersReleasing": "allow",
        "allowEmailToFax": true,
        "allowFaxAttachments": true,
        "allowNumbersForwarding": "allow",
        "allowNumbersManaging": "allow",
        "allowNumbersPorting": "deny",
        "allowUsersManaging": "allow",
        "timezone": "America/Los_Angeles",
        "emailNotifySendOption": "all",
        "emailNotifyReceiveOption": "all",
        "emailNotifySendIncAttachment": true,
        "emailNotifyReceiveIncAttachment": true,
        "emailNotifyEmailToFaxQueued": true,
        "faxCsid": "mFax",
        "faxCallerId": "12021234567",
        "faxDefaultCoverPage": "35fb8cc3-064b-4182-943a-76bf7e64725a",
        "faxLifetime": "31622400",
        "parentId": "35fb8cc3-064b-4182-943a-76bf7e64725a",
        "portingNotificationEmails": ["john@snow.com"],
        "createdAt": "2017-07-05T08:28:14.000Z",
        "updatedAt": "2018-09-04T16:41:14.000Z",
        "childrenCount": 1,
        "usersCount": 17
      },
      "breadcrumb": []
    }
  ]
}

Method: GET

Path: /v1/accounts

Delivers JSON response with all sub accounts of current user account.

Parameters

Name Type In Description
accountType string query Account type. Acceptable values: owner, manager
include string query Include assigned settings or billings. Example: settings,billing
offset integer query Number of pages to return
limit integer query Amount of line items per page that will be returned
order integer query Sort response values by account_name, account_number, fax_csid, fax_caller_id in ascending or descending order. Example: account_name asc
query integer query Search by Account Name, Account Number, Fax CSID or Fax Caller ID

Get account info

Request:

curl -X GET
'https://api.documo.com/v1/accounts/6c838c7c-cb48-4763-84d6-233b5f8cf782' \
-H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/accounts/6c838c7c-cb48-4763-84d6-233b5f8cf782"

headers = {
    'Authorization': "Basic API_KEY",
    }

requests.get(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/accounts/6c838c7c-cb48-4763-84d6-233b5f8cf782';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/accounts/6c838c7c-cb48-4763-84d6-233b5f8cf782")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/accounts/6c838c7c-cb48-4763-84d6-233b5f8cf782',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
  "account": {
    "uuid": "00000000-0000-0000-0000-000000000000",
    "accountName": "Night’s Watch",
    "accountNumber": "1201700000",
    "accountType": "customer",
    "allowAdmin": "inherit",
    "allowApi": "inherit",
    "allowEnterprise": "inherit",
    "allowAdminNumbersProvision": "allow",
    "allowAdminNumbersReleasing": "allow",
    "allowEmailToFax": true,
    "allowFaxAttachments": true,
    "allowNumbersForwarding": "allow",
    "allowNumbersManaging": "allow",
    "allowNumbersPorting": "deny",
    "allowUsersManaging": "allow",
    "timezone": "America/Los_Angeles",
    "emailNotifySendOption": "all",
    "emailNotifyReceiveOption": "all",
    "emailNotifySendIncAttachment": true,
    "emailNotifyReceiveIncAttachment": true,
    "emailNotifyEmailToFaxQueued": true,
    "faxCsid": "mFax",
    "faxCallerId": "12021234567",
    "faxDefaultCoverPage": "35fb8cc3-064b-4182-943a-76bf7e64725a",
    "faxLifetime": "31622400",
    "parentId": "35fb8cc3-064b-4182-943a-76bf7e64725a",
    "portingNotificationEmails": ["john@snow.com"],
    "createdAt": "2017-07-05T08:28:14.000Z",
    "updatedAt": "2018-09-04T16:41:14.000Z",
    "childrenCount": 1,
    "usersCount": 17
  },
  "breadcrumb": []
}

Method: GET

Path: /v1/accounts/{accountId}

Delivers JSON response with current account info and settings.

Parameters

Name Type In Description
accountId string path Account ID

Update account

Request:

curl -X PATCH \
  'https://api.documo.com/v1/accounts/ad39a2c2-d154-4170-83e4-a75fa5466d33' \
  -H 'accept: application/json' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d 'accountName=COMPANY&emailNotifySendOption=all&emailNotifyReceiveOption=all&emailNotifySendIncAttachment=true&emailNotifyReceiveIncAttachment=true&timezone=America%252FLos_Angeles&usersTokenLife=14400&allowEmailToFax=true&allowFaxAttachments=true'
import requests

url = "https://api.documo.com/v1/accounts/ad39a2c2-d154-4170-83e4-a75fa5466d33"

headers = {
    'accept': 'application/json',
    'Authorization': 'Basic API_KEY',
    'cache-control': 'no-cache',
    'content-type': 'application/x-www-form-urlencoded',
    'postman-token': '6d0a0cc6-af1c-645d-e8d0-abfd93a9edd6',
}

data = [
  ('accountName', 'COMPANY'),
  ('emailNotifySendOption', 'all'),
  ('emailNotifyReceiveOption', 'all'),
  ('emailNotifySendIncAttachment', 'true'),
  ('emailNotifyReceiveIncAttachment', 'true'),
  ('timezone', 'America/Los_Angeles'),
  ('usersTokenLife', '14400'),
  ('allowEmailToFax', 'true'),
  ('allowFaxAttachments', 'true'),
]

requests.post(url, headers=headers, data=data)

const request = require("request");

request({
    method: 'PATCH',
    url: 'https://api.documo.com/v1/accounts/ad39a2c2-d154-4170-83e4-a75fa5466d33',
    headers: {
        Authorization: 'Basic API_KEY',
        accept: 'application/json',
        'content-type': 'application/x-www-form-urlencoded'
    },
    form: {
        accountName: 'COMPANY',
        emailNotifySendOption: 'all',
        emailNotifyReceiveOption: 'all',
        emailNotifySendIncAttachment: 'true',
        emailNotifyReceiveIncAttachment: 'true',
        timezone: 'America%2FLos_Angeles',
        usersTokenLife: '14400',
        allowEmailToFax: 'true',
        allowFaxAttachments: 'true'
    }
}, function(error, response, body) {
    console.log(body);
});
<?php
$url = 'https://api.documo.com/v1/accounts/ad39a2c2-d154-4170-83e4-a75fa5466d33';

$body = array(
  'accountName' => 'COMPANY',
  'emailNotifySendOption' => 'all',
  'emailNotifyReceiveOption' => 'all',
  'emailNotifySendIncAttachment' => 'true',
  'emailNotifyReceiveIncAttachment' => 'true',
  'timezone' => 'America/Los_Angeles',
  'usersTokenLife' => '14400',
  'allowEmailToFax' => 'true',
  'allowFaxAttachments' => 'true'
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Accept: application/json',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body
  CURLOPT_CUSTOMREQUEST => 'PATCH'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/accounts/ad39a2c2-d154-4170-83e4-a75fa5466d33")
request = Net::HTTP::Patch.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "accountName" => "COMPANY",
  "emailNotifySendOption" => "all",
  "emailNotifyReceiveOption" => "all",
  "emailNotifySendIncAttachment" => "true",
  "emailNotifyReceiveIncAttachment" => "true",
  "timezone" => "America/Los_Angeles",
  "usersTokenLife" => "14400",
  "allowEmailToFax" => "true",
  "allowFaxAttachments" => "true",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body

Response:

{
    "uuid": "00000000-0000-0000-0000-000000000000",
    "accountName": "Night’s Watch",
    "accountNumber": "1201700000",
    "accountType": "customer",
    "allowAdmin": "inherit",
    "allowApi": "inherit",
    "allowEnterprise": "inherit",
    "allowAdminNumbersProvision": "allow",
    "allowAdminNumbersReleasing": "allow",
    "allowEmailToFax": true,
    "allowFaxAttachments": true,
    "allowNumbersForwarding": "allow",
    "allowNumbersManaging": "allow",
    "allowNumbersPorting": "deny",
    "allowUsersManaging": "allow",
    "timezone": "America/Los_Angeles",
    "emailNotifySendOption": "all",
    "emailNotifyReceiveOption": "all",
    "emailNotifySendIncAttachment": true,
    "emailNotifyReceiveIncAttachment": true,
    "emailNotifyEmailToFaxQueued": true,
    "faxCsid": "mFax",
    "faxCallerId": "12021234567",
    "faxDefaultCoverPage": "35fb8cc3-064b-4182-943a-76bf7e64725a",
    "faxLifetime": "31622400",
    "parentId": "35fb8cc3-064b-4182-943a-76bf7e64725a",
    "portingNotificationEmails": ["john@snow.com"],
    "createdAt": "2017-07-05T08:28:14.000Z",
    "updatedAt": "2018-09-04T16:41:14.000Z",
    "childrenCount": 1,
    "usersCount": 17
}

Method: PATCH

Path: /v1/accounts/{accountId}

This method will allow you to modify global account settings and info. You will need to pass through the account ID and will also need administrative privileges to access.

Parameters

Name Type In Description
accountId string path Account ID
accountName string formData Name of the company
faxCallerId string formData ID of fax caller (10 characters limit)
faxCsid string formData Unique fax ID (20 characters limit)
emailNotifySendOption string formData Outbound fax notification settings. Acceptable values: None, All (default), Success, Failure
emailNotifyReceiveOption string formData Inbound fax notification settings. Acceptable values: None, All (default), Success, Failure
emailNotifySendIncAttachment boolean formData Outbound fax notification attachment settings. Acceptable values: true (default), false
emailNotifyReceiveIncAttachment boolean formData Inbound fax notification attachment settings. Acceptable values: true (default), false
timezone string formData Timezone
allowEmailToFax boolean formData Email to Fax
usersTokenLife integer formData Set manual user token time for this account
isSuspend boolean formData Value of true puts account in suspended status. Users will not be able to login or perform billable functions
suspendAt date formData Sets a date that account will move to suspended status. E.g: ‘2019-01-01T12:00:00.000Z’

Delete account

Request:

curl -X DELETE
  'https://api.documo.com/v1/accounts/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/accounts/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de"

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.delete(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/accounts/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/accounts/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/v1/accounts/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

Status: 200
Message: OK

Method: DELETE

Path: /v1/accounts/{accountId}

Deletes account, users and all assigned numbers. You won’t be able to delete account if it has subbacounts.

Parameters

Parameter Data Type In Description
accountId string path Account ID

Numbers

Retrieve fax numbers

Request:

curl -X GET
'https://api.documo.com/v1/numbers?offset=1&limit=2&query=Test' \
-H 'Accept: application/json'  \
-H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/numbers"

headers = {
    'Accept': 'application/json',
    'Authorization': 'Basic API_KEY',
}

params = (
    ('offset', '1'),
    ('limit', '2'),
    ('query', 'Test'),
)

requests.get(url, headers=headers, params=params)
<?php
$url = 'https://api.documo.com/v1/numbers';

$query = http_build_query(array(
  'offset' => '1',
  'limit' => '2',
  'query' => 'Test'
));

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/json'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => "{$url}?{$query}",
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/numbers")
request = Net::HTTP::Get.new(uri)
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"
params = { :offset => 10, :limit => 3, :query => 'Test' }
uri.query = URI.encode_www_form(params)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/numbers',
    qs: {
        offset: '1',
        limit: '2',
        query: 'Test'
    },
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

 {
  "rows": [
    {
      "uuid": "04d651f6-5092-44a1-bbd4-822a0ab43d29",
      "number": "3144508380",
      "pendingUntil": null,
      "ownedBy": "8d3165b3-d23c-4cb4-9bee-b33013c008f7",
      "managedBy": "8d3165b3-d23c-4cb4-9bee-b33013c008f7",
      "faxbridge": {
        "deviceCode": "210000000000",
        "name": "FaxBridge",
      },
      "users": [
        {
          "userId": "fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de",
          "accountId": "6c838c7c-cb48-4763-84d6-233b5f8cf782",
          "email": "example@mail.com",
          "firstName": "John",
          "lastName": "Doe",
          "avatarUrl": null
        }
      ],
      "owner": {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "accountNumber": "1200000000",
        "accountName": "Night’s Watch",
        "accountType": "customer"
      },
      "manager": {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "accountNumber": "1200000000",
        "accountName": "Night’s Watch",
        "accountType": "customer"
      }
    }
  ],
  "count": 1718,
  "limit": 100,
  "offset": 0
}

Method: GET

Path: /v1/numbers

Returns all fax numbers owned by account

Parameters

Parameter Data Type In Description
accountId string query Account ID
type string query Possible values: available, assigned, pending
offset integer query Number of pages to return
limit integer query Amount of line items per page that will be returned
query string query Search query

Add user to fax number

Request:

curl -X POST
'https://api.documo.com/v1/numbers/7cd0224e-ee05-4f32-9f56-9a4ebf83a38c/user/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/numbers/7cd0224e-ee05-4f32-9f56-9a4ebf83a38c/user/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de"

headers = {
    'Authorization': "Basic API_KEY",
    'content-type': "application/x-www-form-urlencoded"
    }

requests.post(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/numbers/7cd0224e-ee05-4f32-9f56-9a4ebf83a38c/user/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de';

$headers = array(
  'Authorization: Basic API_KEY',
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/numbers/7cd0224e-ee05-4f32-9f56-9a4ebf83a38c/user/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/v1/numbers/7cd0224e-ee05-4f32-9f56-9a4ebf83a38c/user/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
  "uuid": "7cd0224e-ee05-4f32-9f56-9a4ebf83a38c",
  "number": "3122833994",
  "pendingUntil": null,
  "ownedBy": "6c838c7c-cb48-4763-84d6-233b5f8cf782",
  "createdAt": "2017-06-06T11:37:14.000Z",
  "users": [
    {
      "userId": "fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de",
      "accountId": "6c838c7c-cb48-4763-84d6-233b5f8cf782",
      "email": "example@mail.com",
      "firstName": "John",
      "lastName": "Doe",
      "avatarUrl": null
    }
  ],
  "manager": {
      "uuid": "00000000-0000-0000-0000-000000000000",
      "accountNumber": "1200000000",
      "accountName": "Night’s Watch",
      "accountType": "customer"
  }
}

Method: POST

Path: /v1/numbers/{numberId}/user/{userId}

Add users to fax numbers. Only users from account that manages this number can be assigned. Inbound faxes are accessible by the assigned user(s).

Parameters

Parameter Data Type In Description
numberId string path Number ID of fax number
userId string path User ID

Unassign user from fax number

Request:

curl -X DELETE
'https://api.documo.com/v1/numbers/7cd0224e-ee05-4f32-9f56-9a4ebf83a38c/user/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/numbers/7cd0224e-ee05-4f32-9f56-9a4ebf83a38c/user/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de"

headers = {
    'Authorization': "Basic API_KEY",
    'content-type': "application/x-www-form-urlencoded"
    }

requests.delete(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/numbers/7cd0224e-ee05-4f32-9f56-9a4ebf83a38c/user/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/numbers/7cd0224e-ee05-4f32-9f56-9a4ebf83a38c/user/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de")
request = Net::HTTP::Delete.new(uri)
request.content_type = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/v1/numbers/7cd0224e-ee05-4f32-9f56-9a4ebf83a38c/user/fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

Status: 204

Method: DELETE

Path: /v1/numbers/{numberId}/user/{userId}

Remove user from fax number.

Parameters

Parameter Data Type In Description
numberId string path Number ID of fax number
userId string path User ID

Provision fax numbers

Request:

curl -X POST \
  'https://api.documo.com/v1/numbers/provision' \
  -H 'accept: application/json' \
  -H 'Authorization: Basic API_KEY' \
  -F 'numbers=18440000000' \
  -F 'type=order'
import requests

url = "https://api.documo.com/v1/numbers/provision"

headers = {
  'accept': "application/json",
  'Authorization': "Basic API_KEY"
}

data = [
  ('numbers', '18440000000'),
  ('type', 'order'),
]

requests.post(url, headers=headers, data=data)
<?php
$url = 'https://api.documo.com/v1/numbers/provision';

$body = array(
  'numbers' => '+18440000000',
  'type' => 'order'
);

$headers = array(
  'Authorization: Basic API_KEY'
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/numbers/provision")
params = {
    :numbers => "+18440000000",
    :type => "order"
}
uri.query = URI.encode_www_form(params)

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/v1/numbers/provision',
    body: {
        numbers: '+18440000000',
        type: 'order',
    },
    headers: {
        Authorization: 'Basic API_KEY',
        accept: 'application/json'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

[
  {
    "uuid": "2d65b607-1833-4576-b497-650b56d6346b",
    "number": "8440000000",
    "pendingUntil": null,
    "ownedBy": "f6309861-9ca9-44ea-84ab-a193615e4936",
    "managedBy": "f6309861-9ca9-44ea-84ab-a193615e4936",
    "createdAt": "2017-06-26T15:35:13.000Z",
    "owner": {
      "uuid": "00000000-0000-0000-0000-000000000000",
      "accountNumber": "1200000000",
      "accountName": "Night’s Watch",
      "accountType": "customer"
    },
    "manager": {
      "uuid": "00000000-0000-0000-0000-000000000000",
      "accountNumber": "1200000000",
      "accountName": "Night’s Watch",
      "accountType": "customer"
    }
  }
]

Method: POST

Path: /v1/numbers/provision

Provision new fax numbers.

Note: For provision with type ‘order’, numbers in request should have appeared in a number search within the last 24 hours.

Note: Provision is limited to 1000 numbers per API call.

Parameters

Parameter Data Type In Description
type string body Possible values: order, local, toll-free.
numbers string[] body Numbers list in E164 format. Separated by comma.
quantity integer body Toll-free numbers quantity. If not set - equal to 1. Required for random ‘toll-free’ provision.
accountId string body Subaccount ID
storage string body FTP/SFTP storage credentials in JSON format

Search for available numbers

Request:

curl -X GET \
  'https://api.documo.com/v1/numbers/provision/search?npa=934&nxx=800&state=NY' \
  -H 'accept: application/json' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/numbers/provision/search"

querystring = {
    "npa":"934",
    "nxx":"800",
    "state":"NV",
    "city":"Las Vegas",
}

headers = {
  'accept': "application/json",
  'Authorization': "Basic API_KEY"
}

requests.get(url, headers=headers, params=querystring)
<?php
$url = 'https://api.documo.com/v1/numbers/provision/search';

$query = http_build_query(array(
  'npa' => '934',
  'nxx' => '800',
  'state' => 'NV',
  'city' => 'Las Vegas'
));

$headers = array(
  'Authorization: Basic API_KEY',
  'Accept: application/json'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => "{$url}?{$query}",
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/numbers/provision/search")
params = {
    :npa => 934,
    :nxx => 800,
    :state => 'NV'
    :city => 'Las Vegas'
}
uri.query = URI.encode_www_form(params)

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/numbers/provision/search',
    qs: {
        npa: 934,
        nxx: 800,
        state: 'NV',
        city: 'Las Vegas',
    },
    headers: {
        Authorization: 'Basic API_KEY',
        accept: 'application/json'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
  "result": [
    {
      "number_e164": "+17025551234",
      "regional_data": {
        "country_iso": "US",
        "rate_center": "LAS VEGAS",
        "state": "NV"
      },
      "preferable": true,
    },
    ...
  ],
  "limit": 10
}

Method: GET

Path: /v1/numbers/provision/search

Allows you to search for available toll-free or local numbers. Search by area code/prefix (npa/nxx), city, or zip code. Returns list of available numbers.

Parameters

Parameter Data Type In Description
npa string query 3-digit Numbering Code
nxx string query Central Office (aka. Exchange) within the NPA
state string query State
city string query City. State param required for search by city.
zipcode string query ZIP Code
limit number query Amount of line items per page that will be returned

Number settings

curl -X PUT \
  https://api.documo.com/v1/numbers/00708ad6-7981-43fe-94d9-7c74b36f70d5 \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d storage=%7B%22protocol%22%3A%22ftp%22%2C%22host%22%3A%22example.com%22%2C%22outputDirPath%22%3A%22uploads%2F%22%2C%22password%22%3A%22password%22%2C%22user%22%3A%22user%22%2C%22port%22%3A%2221%22%7D
import requests
import json

url = "https://api.documo.com/v1/numbers/00708ad6-7981-43fe-94d9-7c74b36f70d5"

storage = {
    "protocol":"ftp",
    "host":"example.com",
    "outputDirPath":"uploads/",
    "password":"password",
    "user":"user",
    "port":"21"
}

payload = {'storage': json.dumps(storage)}

headers = {
    'Content-Type': "application/x-www-form-urlencoded",
    'Accept': "application/json",
    'Authorization': "Basic API_KEY"
    }

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

print(response.text)
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("https://api.documo.com/v1/numbers/00708ad6-7981-43fe-94d9-7c74b36f70d5")
storage = {
    :protocol => 'ftp',
    :host => 'example.com',
    :outputDirPath => 'uploads',
    :password => 'password',
    :user => 'user',
    :port => 21
}

request = Net::HTTP::Put.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "storage" => storage.to_json,
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end
<?php
$url = 'https://api.documo.com/v1/numbers/00708ad6-7981-43fe-94d9-7c74b36f70d5';

$storage = (object) [
  'protocol' => "ftp",
  'host' => "example.com",
  'outputDirPath' => "uploads/",
  'password' => "password",
  'user' => "user",
  'port' => "21"
];

$body = array(
  'storage' => json.encode($storage)
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Accept: application/json',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body
  CURLOPT_CUSTOMREQUEST => 'PUT'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
const request = require("request");

request({
    method: 'PUT',
    url: 'https://api.documo.com/v1/numbers/00708ad6-7981-43fe-94d9-7c74b36f70d5',
    headers: {
        Authorization: 'Basic API_KEY',
        Accept: 'application/json',
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    form: {
        storage: JSON.stringify({
            protocol: "ftp",
            host: "example.com",
            outputDirPath: "uploads/",
            password: "password",
            user: "user",
            port: 21
        }),
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

{
  "uuid": "7cd0224e-ee05-4f32-9f56-9a4ebf83a38c",
  "number": "3122833994",
  "pendingUntil": null,
  "storage": "{\"protocol\":\"ftp\",\"host\":\"example.com\",\"outputDirPath\":\"uploads/\",\"password\":\"password\",\"user\":\"user\",\"port\":21}",
  "ownedBy": "6c838c7c-cb48-4763-84d6-233b5f8cf782",
  "createdAt": "2017-06-06T11:37:14.000Z",
  "users": [
    {
      "userId": "fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de",
      "accountId": "6c838c7c-cb48-4763-84d6-233b5f8cf782",
      "email": "example@mail.com",
      "firstName": "John",
      "lastName": "Doe",
      "avatarUrl": null
    }
  ],
  "manager": {
    "uuid":"00000000-0000-0000-0000-000000000000",
    "accountNumber":"1200000000",
    "accountName":"Documo",
    "accountType":"customer"
  }
}

Method: PATCH

Path: /v1/numbers/{numberId}

Storage settings of number

Parameters

Parameter Data Type In Description
numberId string query Number ID
storage string body FTP/SFTP storage credentials in JSON format
managedBy uuid body Uuid of manager account

Release number

Request:

curl -X DELETE \
  https://api.documo.com/v1/numbers/00708ad6-7981-43fe-94d9-7c74b36f70d5/release \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/numbers/00708ad6-7981-43fe-94d9-7c74b36f70d5/release"

headers = {
    'Accept': "application/json",
    'Authorization': "Basic API_KEY"
    }

response = requests.request("DELETE", url, headers=headers)
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/numbers/00708ad6-7981-43fe-94d9-7c74b36f70d5/release")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
<?php
$url = 'https://api.documo.com/v1/numbers/00708ad6-7981-43fe-94d9-7c74b36f70d5/release';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/v1/numbers/00708ad6-7981-43fe-94d9-7c74b36f70d5/release',
    headers: {
        Authorization: 'Basic API_KEY',
        Accept: 'application/json'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

Status: 204

Method: DELETE

Path: /v1/numbers/{numberId}/release

Release fax number by number ID and move it to pending.

Parameters

Parameter Data Type In Description
numberId string query Number ID

Validate number

Request:

curl --location --request GET 'localhost:5000/v1/numbers/validate?number=5554443333&country=US'
import requests

url = "localhost:5000/v1/numbers/validate?number=5554443333&country=US"

payload = {}
headers= {}

response = requests.request("GET", url, headers=headers, data = payload)
require "uri"
require "net/http"

url = URI("localhost:5000/v1/numbers/validate?number=5554443333&country=US")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)

response = http.request(request)
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "localhost:5000/v1/numbers/validate?number=5554443333&country=US",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'localhost:5000/v1/numbers/validate?number=5554443333&country=US',
  'headers': {
  }
};

request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Response:

{
  "isValid": false
}

Method: GET

Path: /v1/numbers/validate

Indicates whether a number is valid

Parameters

Parameter Data Type In Description
number string query The number you wish to validate
country string query The Alpha-2 country code

Numbers Porting (beta)

Portability Check

Request:

curl --location --request POST 'https://api.documo.com/v1/porting/portability_check' \
--header 'Authorization: Basic API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "numbers": "+18885550001,+18885550002"
}'
require "uri"
require "net/http"

url = URI("https://api.documo.com/v1/porting/portability_check")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic API_KEY"
request["Content-Type"] = "application/json"
request.body = "{\n    \"numbers\": \"+18885550001,+18885550002\"\n}"

response = https.request(request)
puts response.read_body

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.documo.com/v1/porting/portability_check",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{\n    \"numbers\": \"+18885550001,+18885550002\"\n}",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic API_KEY",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

import requests

url = "https://api.documo.com/v1/porting/portability_check"

payload = "{\n    \"numbers\": \"+18885550001,+18885550002\"\n}"
headers = {
  'Authorization': 'Basic API_KEY',
  'Content-Type': 'application/json'
}

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

print(response.text.encode('utf8'))

const request = require("request");

request
    .post({
        url: 'https://api.documo.com/v1/porting/portability_check',
        headers: {
            Authorization: 'Basic API_KEY'
        },
        body: {
            numbers: '+18885550001,+18885550002'
        }
    })
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error);
    })

Response:

[ 
    { 
        "portable": false,
        "portabilityStatus": null,
        "phoneNumber": "+18885550001",
        "notPortableReason": "not_available",
        "e164Number": "+18885550001",
        "coverageCategory": "nanp_toll_free",
        "carrierName": "NANP TOLL FREE",
    },
    { 
        "portable": true,
        "portabilityStatus": "confirmed",
        "phoneNumber": "+18885550002",
        "notPortableReason": null,
        "e164Number": "+18885550002",
        "coverageCategory": "nanp_toll_free",
        "carrierName": "NANP TOLL FREE"
    } 
]

Method: POST

Path: /v1/porting/portability_check

Verifies the portability of a list of phone numbers. Use before creating draft request.

Parameters

Parameter Data Type In Description
numbers string body Numbers in E164 format, separated by comma. E.g. +18885550001,+18885550002

Create Port Request

Request:

curl --location --request POST 'https://api.documo.com/v1/porting' \
--header 'Authorization: Basic API_KEY' \
--form 'numbers=+18885550001' \
--form 'administrativeArea=NV' \
--form 'authPersonName=John Snow' \
--form 'billingPhoneNumber=+18885550001' \
--form 'personOrCompanyName=Winterfell Armory' \
--form 'locality=Las Vegas' \
--form 'postalCode=880000' \
--form 'streetAddress=Fake address here' \
--form 'extendedAddress=line 2' \
--form 'accountNumber=' \
--form 'portType=full' \
--form 'reminingNumbersAction=keep' \
--form 'newBillingPhoneNumber=+18885550001' \
--form 'countryCode=US' \
--form 'focDate=2021-01-01T12:00:00Z' \
--form 'loa=@home/user/Documents/Sample.pdf' \
--form 'invoice=@home/user/Documents/Sample.pdf'
require "uri"
require "net/http"

url = URI("https://api.documo.com/v1/porting")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic API_KEY'
form_data = [['numbers', '+18885550001'],['administrativeArea', 'NV'],['authPersonName', 'John Snow'],['billingPhoneNumber', '+18885550001'],['personOrCompanyName', 'Winterfell Armory'],['locality', 'Las Vegas'],['postalCode', '880000'],['streetAddress', 'Fake address here'],['extendedAddress', 'line 2'],['accountNumber', ''],['portType', 'full'],['reminingNumbersAction', 'keep'],['newBillingPhoneNumber', '+18885550001'],['countryCode', 'US'],['focDate', '2021-01-01T12:00:00Z'],['loa', File.open('home/user/Documents/Sample.pdf')],['invoice', File.open('home/user/Documents/Sample.pdf')]]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.documo.com/v1/porting",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array('numbers' => '+18885550001','administrativeArea' => 'NV','authPersonName' => 'John Snow','billingPhoneNumber' => '+18885550001','personOrCompanyName' => 'Winterfell Armory','locality' => 'Las Vegas','postalCode' => '880000','streetAddress' => 'Fake address here','extendedAddress' => 'line 2','accountNumber' => '','portType' => 'full','reminingNumbersAction' => 'keep','newBillingPhoneNumber' => '+18885550001','countryCode' => 'US','focDate' => '2021-01-01T12:00:00Z','loa'=> new CURLFILE('home/user/Documents/Sample.pdf'),'invoice'=> new CURLFILE('home/user/Documents/Sample.pdf')),
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic Basic API_KEY"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.documo.com/v1/porting"

payload = {'numbers': '+18885550001',
'administrativeArea': 'NV',
'authPersonName': 'John Snow',
'billingPhoneNumber': '+18885550001',
'personOrCompanyName': 'Winterfell Armory',
'locality': 'Las Vegas',
'postalCode': '880000',
'streetAddress': 'Fake address here',
'extendedAddress': 'line 2',
'accountNumber': '',
'portType': 'full',
'reminingNumbersAction': 'keep',
'newBillingPhoneNumber': '+18885550001',
'countryCode': 'US',
'focDate': '2021-01-01T12:00:00Z'}
files = [
  ('loa', open('home/user/Documents/Sample.pdf','rb')),
  ('invoice', open('home/user/Documents/Sample.pdf','rb'))
]
headers = {
  'Authorization': 'Basic Basic API_KEY'
}

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

print(response.text.encode('utf8'))

const fs = require('fs');
const request = require("request");

request
    .post({
        url: 'https://api.documo.com/v1/porting',
        headers: {
            Authorization: 'Basic API_KEY'
        },
        formData: {
            numbers: '+18885550001',

            administrativeArea: 'NV',
            authPersonName: 'John Snow',
            billingPhoneNumber: '+188855500001',
            personOrCompanyName: 'Winterfell Armory',
            locality: 'Las Vegas',
            postalCode: '880000',
            streetAddress: 'Fake Address Here',
            extendedAddress: 'Line 2',
            accountNumber: '',
            portType: 'full',
            remainingNumbersAction: 'keep',
            newBillingPhoneNumber: '+18885550001',
            countryCode: 'US',
            focDate: '2019-01-01T12:00:00Z',

            loa: {
                value: fs.createReadStream("/home/user/Documents/Loa.pdf"),
                options: {
                    filename: '/home/user/Documents/Sample.pdf',
                    contentType: 'application/pdf'
                }
            },

            invoice: {
                value: fs.createReadStream("/home/user/Documents/Invoice.pdf"),
                options: {
                    filename: '/home/user/Documents/Sample.pdf',
                    contentType: 'application/pdf'
                }
            }
        }
    })
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error);
    })

Response:

{ 
    "uuid": "00000000-0000-0000-0000-000000000000",
    "supportKey": "pr_000000",
    "accountId": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2019-01-01T12:00:00.000Z",
    "account": {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "accountNumber": "1201900000",
        "accountName": "Winterfell Armory",
        "accountType": "reseller"
    },
    "subRequests": [ 
        { 
            "uuid": "00000000-0000-0000-0000-000000000000",
            "portRequestId": "00000000-0000-0000-0000-000000000000",
            "status": "in-process",
            "locality": "Las Vegas",
            "underlyingCarrierNames": ["NANP TOLL FREE"],
            "supportKey": "sr_000000",
            "postalCode": "81465-9911",
            "pinPasscode": null,
            "personOrCompanyName": "Winterfell Armory",
            "focDate": null,
            "streetAddress": "Fake Address Here",
            "extendedAddress": "Line 2",
            "countryCode": "US",
            "billingPhoneNumber": "+18885550001",
            "authPersonName": "John Snow",
            "administrativeArea": "NV",
            "accountNumber": null,
            "portType": "full",
            "remainingNumbersAction": "keep",
            "newBillingPhoneNumber": "+18885550001",
            "createdAt": "2019-01-01T12:00:00.000Z",
            "updatedAt": "2019-01-01T12:00:00.000Z"
        } 
    ],
    "numbers": [ 
        {
            "uuid": "00000000-0000-0000-0000-000000000000",
            "number": "8885550001",
            "numberE164": "+18885550001",
            "pendingRelease": false,
            "isLocal": true,
            "provider": "telnyx",
            "pendingPort": true,
            "portSubRequestId": "00000000-0000-0000-0000-000000000000",
            "managedBy": "00000000-0000-0000-0000-000000000000",
            "ownedBy": "00000000-0000-0000-0000-000000000000",
            "createdAt": "2019-01-01T12:00:00.000Z",
            "updatedAt": "2019-01-01T12:00:00.000Z"
        } 
    ],
    "documents": [
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "description": "_pdf-sample.pdf",
            "subRequestId": "00000000-0000-0000-0000-000000000000",
            "documentType": "invoice",
            "createdAt": "2019-01-01T12:00:00.000Z"
        },
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "description": "_pdf-sample.pdf",
            "subRequestId": "00000000-0000-0000-0000-000000000000",
            "documentType": "loa",
            "createdAt": "2019-01-01T12:00:00.000Z"
        }
    ]
}

Method: POST

Path: /v1/porting

Create port request. Allowed formats for files - pdf, img, png.

Parameters

Parameter Data Type In Description
numbers string formData Numbers in E164 format, separated by comma. E.g. +18885550001,+18885550002
portType string formData ‘partial’ or ‘full’
administrativeArea string formData Two character state abbreviation of billing address
authPersonName string formData Name of person authorizing the port request
billingPhoneNumber string formData Billing phone number associated with these phone numbers
personOrCompanyName string formData Person Name or Company name requesting the port
locality string formData City of billing address
postalCode string formData Postal Code of billing address
streetAddress string formData First line of billing address
extendedAddress string formData Second line of billing address
accountNumber string formData The authorized person’s account number with the current service provider
pinPasscode string formData PIN/passcode for accounts that have wireless type numbers
remainingNumbersAction string formData Remaining numbers can be either kept with their current service provider or disconnected. ‘newBillingPhoneNumber’ is required when ‘remainingNumbersAction’ is ‘keep’.
newBillingPhoneNumber string formData New billing telephone numbers for the remaining numbers. This will be set on your account with your current service provider and should be one of the numbers remaining on that account.
countryCode string formData ISO3166-1 alpha-2 country code of billing address. Only ‘US’ and ‘CA’ is allowed.
focDate string formData ISO 8601 formatted Date/Time of the FOC date
invoice file formData The most recent bill copy/invoice from your current carrier
loa file formData completed Letter of Authorization (LOA)
other file formData Any additional document.

Update Port Request

Request:

const fs = require('fs');
const request = require("request");

request
    .post({
        url: 'https://api.documo.com/v1/porting',
        headers: {
            Authorization: 'Basic API_KEY'
        },
        formData: {
            numbers: '+18885550001',

            administrativeArea: 'NV',
            authPersonName: 'John Snow',
            billingPhoneNumber: '+188855500001',
            personOrCompanyName: 'Winterfell Armory',
            locality: 'Las Vegas',
            postalCode: '880000',
            streetAddress: 'Fake Address Here',
            extendedAddress: 'Line 2',
            accountNumber: '',
            portType: 'full',
            remainingNumbersAction: 'keep',
            newBillingPhoneNumber: '+18885550001',
            countryCode: 'US',

            loa: {
                value: fs.createReadStream("/home/user/Documents/Loa.pdf"),
                options: {
                    filename: '/home/user/Documents/Sample.pdf',
                    contentType: 'application/pdf'
                }
            },

            invoice: {
                value: fs.createReadStream("/home/user/Documents/Invoice.pdf"),
                options: {
                    filename: '/home/user/Documents/Sample.pdf',
                    contentType: 'application/pdf'
                }
            }
        }
    })
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error);
    })

Response:

{ 
    "uuid": "00000000-0000-0000-0000-000000000000",
    "supportKey": "pr_000000",
    "accountId": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2019-01-01T12:00:00.000Z",
    "account": {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "accountNumber": "1201900000",
        "accountName": "Winterfell Armory",
        "accountType": "reseller"
    },
    "subRequests": [ 
        { 
            "uuid": "00000000-0000-0000-0000-000000000000",
            "portRequestId": "00000000-0000-0000-0000-000000000000",
            "status": "in-process",
            "locality": "Las Vegas",
            "underlyingCarrierNames": ["NANP TOLL FREE"],
            "supportKey": "sr_000000",
            "postalCode": "81465-9911",
            "pinPasscode": null,
            "personOrCompanyName": "Winterfell Armory",
            "focDate": null,
            "streetAddress": "Fake Address Here",
            "extendedAddress": "Line 2",
            "countryCode": "US",
            "billingPhoneNumber": "+18885550001",
            "authPersonName": "John Snow",
            "administrativeArea": "NV",
            "accountNumber": null,
            "portType": "full",
            "remainingNumbersAction": "keep",
            "newBillingPhoneNumber": "+18885550001",
            "createdAt": "2019-01-01T12:00:00.000Z",
            "updatedAt": "2019-01-01T12:00:00.000Z"
        } 
    ],
    "numbers": [ 
        {
            "uuid": "00000000-0000-0000-0000-000000000000",
            "number": "8885550001",
            "numberE164": "+18885550001",
            "pendingRelease": false,
            "isLocal": true,
            "provider": "telnyx",
            "pendingPort": true,
            "portSubRequestId": "00000000-0000-0000-0000-000000000000",
            "managedBy": "00000000-0000-0000-0000-000000000000",
            "ownedBy": "00000000-0000-0000-0000-000000000000",
            "createdAt": "2019-01-01T12:00:00.000Z",
            "updatedAt": "2019-01-01T12:00:00.000Z"
        } 
    ],
    "documents": [
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "description": "_pdf-sample.pdf",
            "subRequestId": "00000000-0000-0000-0000-000000000000",
            "documentType": "invoice",
            "createdAt": "2019-01-01T12:00:00.000Z"
        },
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "description": "_pdf-sample.pdf",
            "subRequestId": "00000000-0000-0000-0000-000000000000",
            "documentType": "loa",
            "createdAt": "2019-01-01T12:00:00.000Z"
        }
    ]
}

Method: PATCH

Path: /v1/porting/{uuid}

Edit port sub request. Allowed formats for files - pdf, img, png.

Parameters

Parameter Data Type In Description
administrativeArea string formData Two character state abbreviation of billing address
authPersonName string formData Name of person authorizing the port request
billingPhoneNumber string formData Billing phone number associated with these phone numbers
personOrCompanyName string formData Person Name or Company name requesting the port
locality string formData City of billing address
postalCode string formData Postal Code of billing address
streetAddress string formData First line of billing address
extendedAddress string formData Second line of billing address
accountNumber string formData The authorized person’s account number with the current service provider
pinPasscode string formData PIN/passcode for accounts that have wireless type numbers
countryCode string formData ISO3166-1 alpha-2 country code of billing address. Only ‘US’ and ‘CA’ is allowed.
focDate string formData ISO 8601 formatted Date/Time of the FOC date
invoice file formData The most recent bill copy/invoice from your current carrier
loa file formData completed Letter of Authorization (LOA)
other file formData Any additional document.

Retrieve Port Request

Request:

curl --location --request GET 'https://api.documo.com/v1/porting/:uuid' \
--header 'Authorization: Basic API_KEY'
require "uri"
require "net/http"

url = URI("https://api.documo.com/v1/porting/:uuid")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic API_KEY"

response = https.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.documo.com/v1/porting/:uuid",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic API_KEY"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.documo.com/v1/porting/:uuid"

payload = {}
headers = {
  'Authorization': 'Basic API_KEY'
}

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

print(response.text.encode('utf8'))
const request = require("request");

request
    .get({
        url: 'https://api.documo.com/v1/porting/:uuid',
        headers: {
            Authorization: 'Basic API_KEY'
        }
    })
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error);
    })

Response:

{ 
    "uuid": "00000000-0000-0000-0000-000000000000",
    "supportKey": "pr_000000",
    "accountId": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2019-01-01T12:00:00.000Z",
    "account": {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "accountNumber": "1201900000",
        "accountName": "Winterfell Armory",
        "accountType": "reseller"
    },
    "subRequests": [ 
        { 
            "uuid": "00000000-0000-0000-0000-000000000000",
            "portRequestId": "00000000-0000-0000-0000-000000000000",
            "status": "in-process",
            "locality": "Las Vegas",
            "underlyingCarrierNames": ["NANP TOLL FREE"],
            "supportKey": "sr_000000",
            "postalCode": "81465-9911",
            "pinPasscode": null,
            "personOrCompanyName": "Winterfell Armory",
            "focDate": null,
            "streetAddress": "Fake Address Here",
            "extendedAddress": "Line 2",
            "countryCode": "US",
            "billingPhoneNumber": "+18885550001",
            "authPersonName": "John Snow",
            "administrativeArea": "NV",
            "accountNumber": null,
            "portType": "full",
            "remainingNumbersAction": "keep",
            "newBillingPhoneNumber": "+18885550001",
            "createdAt": "2019-01-01T12:00:00.000Z",
            "updatedAt": "2019-01-01T12:00:00.000Z"
        } 
    ],
    "numbers": [ 
        {
            "uuid": "00000000-0000-0000-0000-000000000000",
            "number": "8885550001",
            "numberE164": "+18885550001",
            "pendingRelease": false,
            "isLocal": true,
            "provider": "telnyx",
            "pendingPort": true,
            "portSubRequestId": "00000000-0000-0000-0000-000000000000",
            "managedBy": "00000000-0000-0000-0000-000000000000",
            "ownedBy": "00000000-0000-0000-0000-000000000000",
            "createdAt": "2019-01-01T12:00:00.000Z",
            "updatedAt": "2019-01-01T12:00:00.000Z"
        } 
    ],
    "documents": [
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "description": "_pdf-sample.pdf",
            "subRequestId": "00000000-0000-0000-0000-000000000000",
            "documentType": "invoice",
            "createdAt": "2019-01-01T12:00:00.000Z"
        },
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "description": "_pdf-sample.pdf",
            "subRequestId": "00000000-0000-0000-0000-000000000000",
            "documentType": "loa",
            "createdAt": "2019-01-01T12:00:00.000Z"
        }
    ]
}

Method: GET

Path: /v1/porting/{uuid}

Returns one port request by UUID.

Parameters

Parameter Data Type In Description
uuid string path Request Uuid

Retrieve All Port Requests

Request:





const request = require("request");

request
    .get({
        url: 'https://api.documo.com/v1/porting/requests',
        headers: {
            Authorization: 'Basic API_KEY'
        }
    })
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error);
    })

Response:

[
    { 
        "uuid": "00000000-0000-0000-0000-000000000000",
        "supportKey": "pr_000000",
        "accountId": "00000000-0000-0000-0000-000000000000",
        "createdAt": "2019-01-01T12:00:00.000Z",
        "account": {
            ...
        },
        "subRequests": [ 
            ...
        ],
        "numbers": [ 
            ...
        ]
    },
    ...
]

Method: GET

Path: /v1/porting/requests

Request:

const request = require("request");

request
    .get({
        url: 'https://api.documo.com/v1/porting/:uuid/documents/:documentId',
        headers: {
            Authorization: 'Basic API_KEY'
        }
    })
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error);
    })

Response:

{
    "url": "https://s3.amazonaws.com/files-service-prod/permanent_storage/..."
}

Method: GET

Path: v1/porting/{uuid}/documents/{documentId}

Parameters

Parameter Data Type In Description
uuid string path Request Uuid
documentId string path Document Id

Cancel Request

Request:

curl --location --request POST "https://api.documo.com/v1/porting/:uuid/cancel?subRequestId='00000000-0000-0000-0000-000000000000'" \
--header 'Authorization: Basic API_KEY'
require "uri"
require "net/http"

url = URI("https://api.documo.com/v1/porting/:uuid/cancel?subRequestId='00000000-0000-0000-0000-000000000000'")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic API_KEY"

response = https.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.documo.com/v1/porting/:uuid/cancel?subRequestId='00000000-0000-0000-0000-000000000000'",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic API_KEY"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.documo.com/v1/porting/:uuid/cancel?subRequestId='00000000-0000-0000-0000-000000000000'"

payload = {}
headers = {
  'Authorization': 'Basic API_KEY'
}

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

print(response.text.encode('utf8'))
const request = require("request");

request
    .get({
        url: 'https://api.documo.com/v1/porting/:uuid/cancel',
        headers: {
            Authorization: 'Basic API_KEY'
        },
        body: {
            subRequestId: '00000000-0000-0000-0000-000000000000'
        }
    })
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error);
    })

Method: POST

Path: v1/porting/{uuid}/cancel

Parameters

Parameter Data Type In Description
uuid string path Request Uuid
subRequestId string path Sub Request Id

FaxBridge

Get FaxBridges

Request:

curl -X GET
  'https://api.documo.com/v1/accounts/faxbridges?offset=0&limit=10?' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/v1/faxbridges"

headers = {
    'Authorization': "Basic API_KEY"
}

requests.get(url, headers=headers)
<?php
$url = 'https://api.documo.com/v1/faxbridges';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/v1/faxbridges")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require('request');

request({
    url: 'https://api.documo.com/v1/faxbridges',
    headers: {
        Accept: 'application/json',
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "rows": [
        {
            "deviceCode": "216061830920",
            "active": false,
            "name":"FaxBridge Name",
            "ownedBy":"00000000-0000-0000-0000-000000000000",
            "managedBy":"00000000-0000-0000-0000-000000000000",
            "faxNumberId": "e7c885cf-6045-43f4-8eb5-2d6c68071292",
            "faxCallerId":"5094570051",
            "ipAddressPublic": "68.104.9.224",
            "ipAddressPrivate": "192.168.0.4",
            "firmware": "20170702B",
            "macAddress": "D8FB11618309",
            "printSentConfirmation":true,
            "printIncomingFaxes":true,
            "timezone": "pacific",
            "orderId": "00000000-0000-0000-0000-000000000000",
            "billing": "classic",
            "purchasedAt": "2020-01-01T12:00:00.000Z",
            "eventDate": "2020-01-01T12:00:00.000Z",
            "activateDate": "2020-01-01T12:00:00.000Z",
            "createdAt": "2020-01-01T12:00:00.000Z",
            "updatedAt": "2020-01-01T12:00:00.000Z",
            "owner":{
                "uuid": "00000000-0000-0000-0000-000000000000",
                "accountNumber": "1200000000",
                "accountName": "Documo",
                "accountType": "customer"
            },
            "manager":{
                "uuid": "00000000-0000-0000-0000-000000000000",
                "accountNumber": "1200000000",
                "accountName": "Documo",
                "accountType": "customer"
            },
            "number":{
                "uuid": "00000000-0000-0000-0000-000000000000",
                "number": "4697292693",
                "pendingUntil": null,
                "ownedBy": "00000000-0000-0000-0000-000000000000",
                "createdAt": "2017-07-15T17:49:05.000Z",
            },
            "users": [
                {
                    "userId": "00000000-0000-0000-0000-000000000000",
                    "firstName": "John",
                    "lastName": "Snow",
                    "email": "john@snow.com"
                },
                ...
            ],
        }
    ],
        "query": {
        "offset": 0,
        "limit": 20
    },
}

Method: GET

Path: /v1/faxbridges

Get FaxBridges list owned by account.

Parameters

Name Type In Description
accountId string query Account ID
query string query Search Query
offset string query Offset
limit string query Limit

Change FaxBridge settings

Request:

curl -X PATCH
'https://api.documo.com/v1/faxbridges/216061830920'  \
-H 'Content-Type: application/x-www-form-urlencoded'  \
-H 'Accept: application/json' \
-H 'Authorization: Basic API_KEY'  \
-d 'name=FaxBridge' \
-d 'printSentConfirmation=true' \
-d 'printIncomingFaxes=true'
import requests

url = "https://api.documo.com/v1/faxbridges/216061830920"

headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Accept': 'application/json',
    'Authorization': 'Basic API_KEY',
}

data = [
  ('name', 'FaxBridge'),
  ('printSentConfirmation', 'true'),
  ('printIncomingFaxes', 'true'),
]

requests.post(url, headers=headers, data=data)
<?php
$url = 'https://api.documo.com/v1/faxbridges/216061830920';

$body = array(
  'name' => 'FaxBridge',
  'printSentConfirmation' => 'true',
  'printIncomingFaxes' => 'true'
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Accept: application/json',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POSTFIELDS => $body
  CURLOPT_CUSTOMREQUEST => 'PATCH'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/v1/faxbridges/216061830920")
request = Net::HTTP::Patch.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "name" => "FaxBridge",
  "printSentConfirmation" => "true",
  "printIncomingFaxes" => "true",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'PATCH',
    url: 'https://api.documo.com/v1/faxbridges/216061830920',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
        name: 'FaxBridge',
        printSentConfirmation: true,
        printIncomingFaxes: true
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "deviceCode": "216061830920",
    "active": false,
    "name":"FaxBridge Name",
    "ownedBy":"00000000-0000-0000-0000-000000000000",
    "managedBy":"00000000-0000-0000-0000-000000000000",
    "faxNumberId": "00000000-0000-0000-0000-000000000000",
    "faxCallerId":"5094570051",
    "ipAddressPublic": "68.104.9.224",
    "ipAddressPrivate": "192.168.0.4",
    "firmware": "20170702B",
    "macAddress": "D8FB11618309",
    "printSentConfirmation":true,
    "printIncomingFaxes":true,
    "timezone": "pacific",
    "orderId": "00000000-0000-0000-0000-000000000000",
    "billing": "classic",
    "purchasedAt": "2020-01-01T12:00:00.000Z",
    "eventDate": "2020-01-01T12:00:00.000Z",
    "activateDate": "2020-01-01T12:00:00.000Z",
    "createdAt": "2020-01-01T12:00:00.000Z",
    "updatedAt": "2020-01-01T12:00:00.000Z",
    "owner":{
        "uuid": "00000000-0000-0000-0000-000000000000",
        "accountNumber": "1200000000",
        "accountName": "Documo",
        "accountType": "customer"
    },
    "manager":{
        "uuid": "00000000-0000-0000-0000-000000000000",
        "accountNumber": "1200000000",
        "accountName": "Documo",
        "accountType": "customer"
    },
    "number":{
        "uuid": "00000000-0000-0000-0000-000000000000",
        "number": "4697292693",
        "pendingUntil": null,
        "ownedBy": "00000000-0000-0000-0000-000000000000",
        "createdAt": "2017-07-15T17:49:05.000Z",
    },
    "users": [
        {
            "userId": "00000000-0000-0000-0000-000000000000",
            "firstName": "John",
            "lastName": "Snow",
            "email": "john@snow.com"
        },
        ...
    ],
}

Method: PATCH

Path: /v1/faxbridges/{deviceCode}

Change FaxBridge settings.

Parameters

Name Type In Description
deviceCode string path FaxBridge device code
name string body Customize FaxBridge name (256 characters limit)
active string body FaxBridge activation
printSentConfirmation boolean body Print sent confirmation
printIncomingFaxes boolean body Print incoming faxes
faxCallerId string body Fax Caller Id (10 characters limit)
managedBy uuid body Uuid of manager account
faxNumberId uuid body Uuid of number
timezone strign body Possible values: ‘pacific’, ‘mountain’, ‘arizona’, ‘central’, ‘eastern’, ‘alaska’, ‘hawaii’

Reports

Summary Report

Request:

curl -X GET \
  'https://api.documo.com/v1/reports/summary?startDate=2017-01-01T00:00:00.000Z&endDate=2027-01-01T00:00:00.000Z&csv=false&limit=50&includeSubaccounts=false&accountId=00000000-0000-0000-0000-000000000000&offset=0&reportState=accounts' \
  -H 'Authorization: Basic API_KEY'
<?php
$url = 'https://api.documo.com/v1/reports/summary';

$query = http_build_query(array(
  'startDate' => '2017-01-01T00:00:00.000Z',
  'endDate' => '2027-01-01T00:00:00.000Z',
  'csv' => 'false',
  'limit' => '50',
  'includeSubaccounts' => 'false',
  'accountId' => '00000000-0000-0000-0000-000000000000',
  'offset' => '0',
  'reportState' => 'accounts'
));

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => "{$url}?{$query}",
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
import requests

url = "https://api.documo.com/v1/reports/summary"

querystring = {
    "startDate":"2017-01-01T00:00:00.000Z",
    "endDate":"2027-01-01T00:00:00.000Z",
    "csv":"false",
    "limit":"50",
    "includeSubaccounts":"false",
    "accountId":"00000000-0000-0000-0000-000000000000",
    "offset":"0",
    "reportState":"accounts"
    }

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.get(url, headers=headers, params=querystring)
require 'uri'
require 'net/http'

uri = URI.parse("https://api.documo.com/v1/reports/summary")

request = Net::HTTP::Get.new(uri)
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"

params = {
    :startDate => '2017-01-01T00:00:00.000Z',
    :endDate => '2027-01-01T00:00:00.000Z',
    :csv => false,
    :limit => 50,
    :includeSubaccounts => false,
    :accountId => '00000000-0000-0000-0000-000000000000',
    :offset => 0,
    :reportState => 'accounts'
    }

uri.query = URI.encode_www_form(params)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/reports/summary',
    qs: {
        startDate: '2017-01-01T00:00:00.000Z',
        endDate: '2027-01-01T00:00:00.000Z',
        csv: false,
        limit: 50,
        includeSubaccounts: false,
        accountId: '00000000-0000-0000-0000-000000000000',
        offset: 0,
        reportState: 'accounts'
    },
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

{
    "count": 1,
    "rows": [
        {
            "accountType": "master",
            "accountName": "The Master Account",
            "accountNumber": "1234567891",
            "totalAttempts": 400,
            "totalDuration": 123456,
            "totalFailed": 42,
            "totalSuccess": 500,
            "totalPages": 400,
            "totalFaxes": 350
        }
    ]
}

Method: GET

Path: /v1/reports/summary

Returns summary report

Parameters

Parameter Data Type In Description
startDate string query Start date as ISO 8601 string. Filtering by ‘resolvedDate’
endDate string query End date as ISO 8601 string. Filtering by ‘resolvedDate’
csv boolean query If true - returns result as .csv file
offset integer query Number of pages to return
limit integer query Amount of line items per page that will be returned
reportState string query Accepts accounts, users, numbers, or faxbridges. Defaults to users.
includeSubaccounts boolean query Include children to report
accountId string query Filter by account

Detailed Report

Request:

curl -X GET \
  'https://api.documo.com/v1/reports/detailed?startDate=2017-01-01T00:00:00.000Z&endDate=2027-01-01T00:00:00.000Z&csv=false&limit=50&includeSubaccounts=false&accountId=00000000-0000-0000-0000-000000000000&offset=0&reportState=accounts&status=all&direction=all' \
  -H 'Authorization: Basic API_KEY'
<?php
$url = 'https://api.documo/v1/reports/detailed';

$query = http_build_query(array(
  'startDate' => '2017-01-01T00:00:00.000Z',
  'endDate' => '2027-01-01T00:00:00.000Z',
  'csv' => 'false',
  'limit' => '50',
  'includeSubaccounts' => 'false',
  'accountId' => '00000000-0000-0000-0000-000000000000',
  'offset' => '0',
  'reportState' => 'accounts',
  'status' => 'all',
  'direction' => 'all'
));

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => "{$url}?{$query}",
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
import requests

url = "https://api.documo.com/v1/reports/detailed"

querystring = {
    "startDate":"2017-01-01T00:00:00.000Z",
    "endDate":"2027-01-01T00:00:00.000Z",
    "csv":"false",
    "limit":"50",
    "includeSubaccounts":"false",
    "accountId":"00000000-0000-0000-0000-000000000000",
    "offset":"0",
    "reportState":"accounts",
    "status":"all",
    "direction":"all"
    }

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.get(url, headers=headers, params=querystring)
require 'uri'
require 'net/http'

uri = URI.parse("https://api.documo.com/v1/reports/detailed")

request = Net::HTTP::Get.new(uri)
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"

params = {
    :startDate => '2017-01-01T00:00:00.000Z',
    :endDate => '2027-01-01T00:00:00.000Z',
    :csv => false,
    :limit => 50,
    :includeSubaccounts => false,
    :accountId => '00000000-0000-0000-0000-000000000000',
    :offset => 0,
    :reportState => 'accounts',
    :status => 'all',
    :direction => 'all'
    }

uri.query = URI.encode_www_form(params)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/reports/detailed',
    qs: {
        startDate: '2017-01-01T00:00:00.000Z',
        endDate: '2027-01-01T00:00:00.000Z',
        csv: false,
        limit: 50,
        includeSubaccounts: false,
        accountId: '00000000-0000-0000-0000-000000000000',
        offset: 0,
        reportState: 'accounts',
        status: 'all',
        direction: 'all'
    },
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

{
    "count": 335,
    "rows": [
        {
            "messageId": "2171207141356933403",
            "faxNumber": "+18885551234",
            "faxCsid": "mFax",
            "faxCallerId": "1234567891",
            "direction": "outbound",
            "status": "success",
            "createdAt": "2017-12-07T14:13:54.000Z",
            "account_name": "The Master Account",
            "faxAttempt": 1,
            "isSuccess": true,
            "pages": 1,
            "faxResultCode": 0,
            "faxErrorCode": 0,
            "faxDuration": 31332,
            "faxDetected": true,
            "faxEcm": "256",
            "faxSpeed": 33600,
            "faxProtocol": "34",
            "user": {
                "email": "john@doe.com",
                "account": {
                    "isReseller": 1,
                    "accountNumber": "1234567891"
                }
            }
        },
        ...
    ]
}

Method: GET

Path: /v1/reports/detailed

Returns detailed report

Parameters

Parameter Data Type In Description
userId string query Filter by User ID
startDate string query Start date as ISO 8601 string. Filtering by ‘resolvedDate’
endDate string query End date as ISO 8601 string. Filtering by ‘resolvedDate’
csv boolean query If true - returns result as .csv file
offset integer query Number of pages to return
limit integer query Amount of line items per page that will be returned
status string query Fax status - all, failed, success
direction string query Can be all, inbound, outbound
reportState string query Accepts accounts and users
includeSubaccounts boolean query Include children to report
accountId string query Filter by account

Billing Report

Request:

curl -X GET \
  'https://api.documo.com/v1/reports/billing?csv=false&accountId=00000000-0000-0000-0000-000000000000' \
  -H 'Authorization: Basic API_KEY'
<?php
$url = 'https://api.documo/v1/reports/billing';

$query = http_build_query(array(
  'csv' => 'false',
  'accountId' => '00000000-0000-0000-0000-000000000000',
));

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => "{$url}?{$query}",
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
import requests

url = "https://api.documo.com/v1/reports/billing"

querystring = {
    "csv":"false",
    "accountId":"00000000-0000-0000-0000-000000000000",
    }

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.get(url, headers=headers, params=querystring)
require 'uri'
require 'net/http'

uri = URI.parse("https://api.documo.com/v1/reports/billing")

request = Net::HTTP::Get.new(uri)
request["Accept"] = "application/json"
request["Authorization"] = "Basic API_KEY"

params = {
    :csv => false,
    :accountId => '00000000-0000-0000-0000-000000000000',
    }

uri.query = URI.encode_www_form(params)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/v1/reports/billing',
    qs: {
        csv: false,
        accountId: '00000000-0000-0000-0000-000000000000',
    },
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function (error, response, body) {
    console.log(body);
});

Response:

{
    "rows": [
        {
            "uuid": "123a4a5a-9999-4444-8888-bb12e3e4abcde",
            "accountName": "Account Name",
            "accountNumber": "2221184399",
            "accountType": "reseller",
            "subaccounts": 10,
            "numbers": 15,
            "users": 25
        },
        ...
    ]
}

Method: GET

Path: /v1/reports/billing

Returns billing report

Parameters

Parameter Data Type In Description
csv boolean query If true - returns result as .csv file
accountId string query Filter by account

Webhooks

Create webhook

Request:

curl -X POST
  'https://api.documo.com/webhooks' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -F 'name=Webhook' \
  -F 'url=https://webhook.com/test' \
  -F 'events={"fax.inbound":true,"fax.outbound":true}'
import requests

url = "https://api.documo.com/webhooks"

headers = {
    'Authorization': 'Basic API_KEY',
    'content-type': 'application/x-www-form-urlencoded',
}

data = [
    ('name', 'Webhook'),
    ('url', 'https://webhook.com/test'),
    ('events', '{"fax.inbound":true,"fax.outbound":true}'),
]

requests.post(url, headers=headers, data=data)

<?php
$url = 'https://api.documo.com/webhooks';

$body = array(
  'name' => 'Webhook',
  'url' => 'https://webhook.com/test',
  'events' => '{"fax.inbound":true,"fax.outbound":true}',
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);

require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/webhooks")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "name" => "Webhook",
  "url" => "https://webhook.com/test",
  "events" => "{"fax.inbound":true,"fax.outbound":true}",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/webhooks',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
        name: 'Webhook',
        url: 'https://webhook.com/test',
        events: {"fax.inbound":true,"fax.outbound":true},
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "uuid": "00000000-0000-0000-0000-000000000000",
    "name": "Webhook",
    "enabled": true,
    "url": "https://webhook.com/test",
    "auth": null,
    "accountId": "00000000-0000-0000-0000-000000000000",
    "numberId": null,
    "events": [
        "fax.inbound",
        "fax.outbound",
        "user.create",
        "user.delete",
        "number.add",
        "number.release"
    ],
    "dataAlias": "data",
    "attachmentAlias": "attachment",
    "notificationEmails": null,
    "createdAt": "2020-01-01T00:00:00.000Z",
    "updatedAt": "2020-01-01T00:00:00.000Z",
    "account": {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "accountName": "Night’s Watch",
        "accountNumber": "1202000000",
        "accountType": "customer"
    }
}

Method: POST

Path: /webhooks

Parameters

Name Type In Description
name string formData Webhook Name
url string formData Webhook URL
events string formData Events Object
auth string formData Basic Auth (e.g: ‘username:password’)
accountId string formData Account UUID
numberId string formData Fax Number UUID
attachmentEnabled boolean formData
notificationEmails string formData

Update webhook

Request:

curl -X PATCH
  'https://api.documo.com/webhooks/00000000-0000-0000-0000-000000000000' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -F 'name=Webhook' \
  -F 'url=https://webhook.com/test' \
  -F 'events={"fax.inbound":true,"fax.outbound":true}'
import requests

url = "https://api.documo.com/webhooks/00000000-0000-0000-0000-000000000000"

headers = {
    'Authorization': 'Basic API_KEY',
    'content-type': 'application/x-www-form-urlencoded',
}

data = [
    ('name', 'Webhook'),
    ('url', 'https://webhook.com/test'),
    ('events', '{"fax.inbound":true,"fax.outbound":true}'),
]

requests.patch(url, headers=headers, data=data)

<?php
$url = 'https://api.documo.com/webhooks/00000000-0000-0000-0000-000000000000';

$body = array(
  'name' => 'Webhook',
  'url' => 'https://webhook.com/test',
  'events' => '{"fax.inbound":true,"fax.outbound":true}',
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_PATCH => true,
  CURLOPT_PATCHFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);

require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/webhooks/00000000-0000-0000-0000-000000000000")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "name" => "Webhook",
  "url" => "https://webhook.com/test",
  "events" => "{"fax.inbound":true,"fax.outbound":true}",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'PATCH',
    url: 'https://api.documo.com/webhooks/00000000-0000-0000-0000-000000000000',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
        name: 'Webhook',
        url: 'https://webhook.com/test',
        events: {"fax.inbound":true,"fax.outbound":true},
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "uuid": "00000000-0000-0000-0000-000000000000",
    "name": "Webhook",
    "enabled": true,
    "url": "https://webhook.com/test",
    "auth": null,
    "accountId": "00000000-0000-0000-0000-000000000000",
    "numberId": null,
    "events": [
        "fax.inbound",
        "fax.outbound",
        "user.create",
        "user.delete",
        "number.add",
        "number.release"
    ],
    "dataAlias": "data",
    "attachmentAlias": "attachment",
    "notificationEmails": null,
    "createdAt": "2020-01-01T00:00:00.000Z",
    "updatedAt": "2020-01-01T00:00:00.000Z",
    "account": {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "accountName": "Night’s Watch",
        "accountNumber": "1202000000",
        "accountType": "customer"
    }
}

Method: PATCH

Path: /webhooks/{uuid}

Parameters

Name Type In Description
uuid string path Webhook UUID
name string formData Webhook Name
url string formData Webhook URL
events string formData Events Object
auth string formData Basic Auth (e.g: ‘username:password’)
accountId string formData Account UUID
numberId string formData Fax Number UUID
attachmentEnabled boolean formData
notificationEmails string formData

Delete webhook

Request:

curl -X DELETE
  'https://api.documo.com/webhooks/00000000-0000-0000-0000-000000000000' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/webhooks/00000000-0000-0000-0000-000000000000"

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.delete(url, headers=headers)
<?php
$url = 'https://api.documo.com/webhooks/00000000-0000-0000-0000-000000000000';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
  CURLOPT_CUSTOMREQUEST => 'DELETE'
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/webhooks/00000000-0000-0000-0000-000000000000")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'DELETE',
    url: 'https://api.documo.com/webhooks/00000000-0000-0000-0000-000000000000',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

Status: 200
Message: OK

Method: DELETE

Path: /webhooks/{uuid}

Deletes webhook.

Parameters

Parameter Data Type In Description
uuid string path Webhook UUID

Get webhooks

Request:

curl -X GET
  'https://api.documo.com/webhooks?accountId=fdb9f0dd-ac0c-4f3e-8e4b-1be0225186de' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/webhooks"

headers = {
    'Authorization': "Basic API_KEY"
    }

requests.get(url, headers=headers)
<?php
$url = 'https://api.documo.com/webhooks';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/webhooks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require('request');

request({
    url: 'https://api.documo.com/webhooks',
    headers: {
        Accept: 'application/json',
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Response:

{
    "count": 10,
    "rows": [
      {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "name": "Webhook",
        "enabled": true,
        "url": "https://webhook.com/test",
        "auth": null,
        "accountId": "00000000-0000-0000-0000-000000000000",
        "numberId": null,
        "events": [
            "fax.inbound",
            "fax.outbound",
            "user.create",
            "user.delete",
            "number.add",
            "number.release"
        ],
        "dataAlias": "data",
        "attachmentAlias": "attachment",
        "notificationEmails": null,
        "createdAt": "2020-01-01T00:00:00.000Z",
        "updatedAt": "2020-01-01T00:00:00.000Z",
      },
      ...
    ]
}

Method: GET

Path: /webhooks

Get all webhooks for account or fax number specified in query.

Parameters

Name Type In Description
accountId string path Account’s UUID
numberId number query Fax Number UUID

Drive (beta)

Create Folder

Request:

curl -X POST
  'https://api.documo.com/folders' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -F 'name=New Folder' \
  -F 'sharedWithAccount=true' \
  -F 'parentId=00000000-0000-0000-0000-000000000000' \
  -F 'userId=00000000-0000-0000-0000-000000000000'
import requests

url = "https://api.documo.com/folders"

headers = {
    'Authorization': 'Basic API_KEY',
    'content-type': 'application/x-www-form-urlencoded',
}

data = [
    ('name', 'New Folder'),
    ('sharedWithAccount', 'true'),
    ('parentId', '00000000-0000-0000-0000-000000000000'),
    ('userId', '00000000-0000-0000-0000-000000000000'),
]

requests.post(url, headers=headers, data=data)

<?php
$url = 'https://api.documo.com/v1/users';

$body = array(
  'name' => 'New Folder',
  'sharedWithAccount' => 'true',
  'parentId' => '00000000-0000-0000-0000-000000000000',
  'userId' => '00000000-0000-0000-0000-000000000000',
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: application/x-www-form-urlencoded'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);

require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/folders")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/x-www-form-urlencoded"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "name" => "New Folder",
  "sharedWithAccount" => "true",
  "parentId" => "00000000-0000-0000-0000-000000000000",
  "userId" => "00000000-0000-0000-0000-000000000000",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/folders',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'application/x-www-form-urlencoded'
    },
    formData: {
        name: 'New Folder',
        sharedWithAccount: true,
        parentId: '00000000-0000-0000-0000-000000000000',
        userId: '00000000-0000-0000-0000-000000000000',
    }
}, function(error, response, body) {
    console.log(body);
});

Method: POST

Path: /folders

Creates a folder.

Parameters

Name Type In Description
name string formData Folder Name
sharedWithAccount boolean formData Setting this to ‘true’ will make this folder accessible by users across the account
parentId string formData If you wish to create this folder within another folder, pass the UUID of the parent folder
userId string formData UUID of the user who owns this folder

Get Folder

Request:

curl -X GET
  'https://api.documo.com/folders/00000000-0000-0000-0000-000000000000' \
  -H 'Authorization: Basic API_KEY'
import requests

url = "https://api.documo.com/folders/00000000-0000-0000-0000-000000000000"

headers = {
    'Authorization': 'Basic API_KEY'
}

requests.get(url, headers=headers)
<?php
$url = 'https://api.documo.com/folders/00000000-0000-0000-0000-000000000000';

$headers = array(
  'Authorization: Basic API_KEY'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);
print_r($response);
require 'uri'
require 'net/http'

url = URI("https://api.documo.com/folders/00000000-0000-0000-0000-000000000000")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic API_KEY'

response = http.request(request)
puts response.read_body
const request = require("request");

request({
    method: 'GET',
    url: 'https://api.documo.com/folders/00000000-0000-0000-0000-000000000000',
    headers: {
        Authorization: 'Basic API_KEY'
    }
}, function(error, response, body) {
    console.log(body);
});

Method: GET

Path: /folders/{uuid}

Get user by ID.

Parameters

Name Type In Description
uuid string path Folder’s UUID

Upload File

Request:

curl -X POST
  'https://api.documo.com/files' \
  -H 'Authorization: Basic API_KEY' \
  -H 'content-type: multipart/form-data' \
  -F 'isPublic=true' \
  -F 'sharedWithAccount=true' \
  -F 'folderId=00000000-0000-0000-0000-000000000000' \
  -F 'userId=00000000-0000-0000-0000-000000000000' \
  -F 'files=@/home/user/Documents/Sample.pdf'
import requests

url = "https://api.documo.com/files"

headers = {
    'Authorization': 'Basic API_KEY',
}

data = [
    ('isPublic', 'true'),
    ('sharedWithAccount', 'true'),
    ('folderId', '00000000-0000-0000-0000-000000000000'),
    ('userId', '00000000-0000-0000-0000-000000000000'),
]

attachments = [
    ('files', ('sample.pdf', open('sample.pdf', 'rb'), 'application/pdf'),
]

requests.post(url, headers=headers, data=data, files=attachments)

print(results.text)
require 'net/http'
require 'uri'

uri = URI.parse("https://api.documo.com/files")
request = Net::HTTP::Post.new(uri)
request.content_type = "multipart/form-data"
request["Authorization"] = "Basic API_KEY"
request.set_form_data(
  "isPublic" => "true",
  "sharedWithAccount" => "true",
  "folderId" => "00000000-0000-0000-0000-000000000000",
  "userId" => "00000000-0000-0000-0000-000000000000",
  "files" => "/home/user/Documents/Sample.pdf",
)

req_options = {
  use_ssl: uri.scheme == "https",
}

response = http.request(request)
puts response.read_body
<?php
$url = 'https://api.documo.com/files';

$file = new CURLFile('/home/user/Documents/Sample.pdf', 'application/pdf', 'sample_name');
$body = array(
  'isPublic' => 'true',
  'sharedWithAccount' => 'true',
  'folderId' => '00000000-0000-0000-0000-000000000000',
  'userId' => '00000000-0000-0000-0000-000000000000',
  'files' => $file
);

$headers = array(
  'Authorization: Basic API_KEY',
  'Content-Type: multipart/form-data'
);

$ch = curl_init();

$options = array(
  CURLOPT_URL => $url,
  CURLOPT_HTTPHEADER => $headers,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $body
);
curl_setopt_array($ch, $options);

$response = curl_exec($ch);
curl_close($ch);

print_r($response);
const fs = require("fs");
const request = require("request");

request({
    method: 'POST',
    url: 'https://api.documo.com/files',
    headers: {
        Authorization: 'Basic API_KEY',
        'content-type': 'multipart/form-data'
    },
    formData: {
        isPublic: true,
        sharedWithAccount: true,
        parentId: '00000000-0000-0000-0000-000000000000',
        userId: '00000000-0000-0000-0000-000000000000',
        files: {
            value: fs.createReadStream("/home/user/Documents/Sample.pdf"),
            options: {
                filename: '/home/user/Documents/Sample.pdf',
                contentType: 'application/pdf'
            }
        }
    }
}, function(error, response, body) {
    console.log(body);
});

Method: POST

Path: /files

Parameters

Name Type In Description
isPublic boolean formData Makes file accessible by direct link stored in publicHref
sharedWithAccount boolean formData Setting this to ‘true’ will make this file accessible by users across the account
folderId string formData UUID of the folder where the file will reside
userId string formData UUID of the user who owns this folder

Errors

The Documo API uses the following error codes:

Error Code Meaning
400 Invalid Input
401 Unauthorized
403 Forbidden
404 Not Found
405 Method Not Allowed
500 Internal Server Error
503 Service Unavailable

You may also find useful How To’s and tips by visiting our Help Center.