Menu

Reference

Folders

Folders: 4 operations (folders.list, folders.create, folders.update, folders.delete).

MethodPathOperation
GET/v1/foldersfolders.list
POST/v1/foldersfolders.create
PATCH/v1/folders/{folder_id}folders.update
DELETE/v1/folders/{folder_id}folders.delete

folders.list

GET/v1/folders

The workspace's lead folders with their lead counts, and how many leads are in none.

Operation idfolders.list
Scopesleads:read
Rate class`read`
IdempotencyNot applicable
KeysDeveloper keys

Response 200

FieldTypeRequiredDescription
dataobject[]yes
unfiled_countintegeryes-9007199254740991 to 9007199254740991

Errors

Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.

Example

bash
curl "https://api.dmhero.ai/v1/folders" \
  -H "Authorization: Bearer $DMHERO_API_KEY"
JSON Schema
Response 200
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "lead_count": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "id",
          "name",
          "lead_count",
          "created_at"
        ],
        "additionalProperties": false
      }
    },
    "unfiled_count": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "data",
    "unfiled_count"
  ],
  "additionalProperties": false
}

folders.create

POST/v1/folders

Create a lead folder.

Operation idfolders.create
Scopesleads:write
Rate class`write`
Idempotency`Idempotency-Key` accepted
KeysDeveloper keys

Request body

FieldTypeRequiredDescription
namestringyes

Response 201

FieldTypeRequiredDescription
created_atdate-timeyes
idstringyes
lead_countintegeryes-9007199254740991 to 9007199254740991
namestringyes

Errors

StatusCodeWhen
409`FOLDER_NAME_TAKEN_409`A folder with this name already exists in the workspace.

Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.

Example

bash
curl -X POST "https://api.dmhero.ai/v1/folders" \
  -H "Authorization: Bearer $DMHERO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string"
}'
JSON Schema
Request body
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    }
  },
  "required": [
    "name"
  ]
}
Response 201
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "lead_count": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    }
  },
  "required": [
    "id",
    "name",
    "lead_count",
    "created_at"
  ],
  "additionalProperties": false
}

folders.update

PATCH/v1/folders/{folder_id}

Rename a lead folder.

Operation idfolders.update
Scopesleads:write
Rate class`write`
IdempotencyNot applicable
KeysDeveloper keys

Path parameters

NameTypeRequiredDescription
folder_idstringyesThe folder id.. 1 to 200 characters

Request body

FieldTypeRequiredDescription
namestringyes

Response 200

FieldTypeRequiredDescription
created_atdate-timeyes
idstringyes
lead_countintegeryes-9007199254740991 to 9007199254740991
namestringyes

Errors

StatusCodeWhen
404`FOLDER_NOT_FOUND_404`No folder with this id exists in this workspace.
409`FOLDER_NAME_TAKEN_409`A folder with this name already exists in the workspace.

Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.

Example

bash
curl -X PATCH "https://api.dmhero.ai/v1/folders/string" \
  -H "Authorization: Bearer $DMHERO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string"
}'
JSON Schema
Request body
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    }
  },
  "required": [
    "name"
  ]
}
Response 200
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "lead_count": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    }
  },
  "required": [
    "id",
    "name",
    "lead_count",
    "created_at"
  ],
  "additionalProperties": false
}

folders.delete

DELETE/v1/folders/{folder_id}

Delete a lead folder. Its leads are kept and end up in no folder.

Operation idfolders.delete
Scopesleads:write
Rate class`write`
IdempotencyNot applicable
KeysDeveloper keys

Path parameters

NameTypeRequiredDescription
folder_idstringyesThe folder id.. 1 to 200 characters

Response 204

No body.

Errors

StatusCodeWhen
404`FOLDER_NOT_FOUND_404`No folder with this id exists in this workspace.

Every operation can also answer the shared errors: authentication, scopes, rate limits and validation.

Example

bash
curl -X DELETE "https://api.dmhero.ai/v1/folders/string" \
  -H "Authorization: Bearer $DMHERO_API_KEY"
Folders | DM Hero Developers