Skip to main content

Contacts & Accounts

Handle ImBox contacts and accounts. A contact can be connected to an account with the accountId property.

Create contact​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*StringUnique id for the user

Body​

NameTypeDescription
accountIdInteger | nullAdds this contact to an existing account.
descriptionString | nullMax 500 characters.
externalIdString | nullMax 50 characters.
externalUrlString | nullMax 250 characters.
firstNameString | nullYou must provide at least one of firstName or lastName. Max 50 characters.
lastNameString | nullYou must provide at least one of firstName or lastName. Max 50 characters.
fullNameString | nullIf not provided, it is constructed from firstName and lastName. Max 100 characters.
titleString | nullMax 50 characters.
addressesArray<{ address: String, isPrimary: Boolean }> | nullOnly the first address marked isPrimary is kept, and if none is marked, the first entry becomes primary. Max 200 characters.
emailsArray<{ email: String, isPrimary: Boolean }> | nullOnly the first email marked isPrimary is kept, and if none is marked, the first entry becomes primary. Max 250 characters
phonesArray<{ phone: String, isPrimary: Boolean }> | nullMust be in E.164 format. Only the first phone marked isPrimary is kept, and if none is marked, the first entry becomes primary.
labelsArray<String> | nullLabels to attach to the contact. Case sensitive. If the label does not exist it will not be addded to the contact.

Usage​

curl -X POST -H "Content-Type: application/json" -d @contact.json "https://apiv2.imbox.io/api/:apiKey/:userId/contacts"

contact.json​

{
"firstName": "Arne",
"lastName": "Andersson",
"title": "CEO",
"description": "This is a contact description",
"emails": [{ "email": "arne@example.com", "isPrimary": true }],
"phones": [{ "phone": "+46762004545", "isPrimary": true }],
"externalUrl": "http://example.com/abc/123",
"externalId": "123",
"accountId": 45
}

Response​

200 OK​

{
"id": 100,
"userId": 200,
"crmId": 1,
"accountId": 45,
"externalId": "123",
"externalUrl": "http://example.com/abc/123",
"firstName": "Arne",
"lastName": "Andersson",
"fullName": "Arne Andersson",
"title": "CEO",
"picture": null,
"activityAt": "2020-01-01T13:00:00.000Z",
"createdAt": "2020-01-01T13:00:00.000Z",
"description": "This is a contact description",
"addresses": [],
"emails": [{ "email": "arne@example.com", "isPrimary": true }],
"phones": [{ "phone": "+46762004545", "isPrimary": true }],
"labels": []
}

400 Bad Request​

{
"message": "Validation",
"errors": [
{
"value": "", // The invalid value you provided
"index": 0, // The index of the invalid item, if it's in an array
"label": "firstName" // The name of the invalid property
},
{
"value": "example.com",
"index": 1,
"label": "emails"
}
]
}
{
"message": "accountId not found",
"errors": []
}

409 Conflict​

{
"message": "Conflict",
"error": {
"field": "email",
"row": {
"email": "name@example.com",
"isPrimary": true
}
}
}
{
"message": "Conflict",
"error": {
"field": "phone",
"row": {
"phone": "+46701740635",
"isPrimary": true
}
}
}
{
"message": "Conflict",
"error": {
"field": "unknown",
}
}

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsWrite

Update contact​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*StringUnique id for the user
id*IntegerId of the contact

Body​

NameTypeDescription
accountIdInteger | nullAdd this contact to an existing account. Send null to remove the contact from its current account.
descriptionString | nullMax 500 characters.
externalIdString | nullMax 50 characters.
externalUrlString | nullMax 250 characters.
firstNameString | nullMax 50 characters.
lastNameString | nullMax 50 characters.
fullNameString | nullIf not provided, it is reconstructed from firstName and lastName, using the current values if not included in the request. Max 100 characters.
titleString | nullMax 50 characters.
addressesArray<{ address: String, isPrimary: Boolean }> | nullReplaces all existing addresses. Only the address first marked isPrimary is kept, and if none is marked, the first entry becomes primary. Max 200 characters.
emailsArray<{ email: String, isPrimary: Boolean }> | nullReplaces all existing emails. Only the first email marked isPrimary is kept, and if none is marked, the first entry becomes primary. Max 250 characters.
phonesArray<{ phone: String, isPrimary: Boolean }> | nullReplaces all existing phones. Must be in E.164 format. Only the first phone marked isPrimary is kept, and if none is marked, the first entry becomes primary.
labelsArray<String> | nullReplaces all labels on the contact. Case sensitive. If the label does not exist it will not be added to the contact.

Usage​

curl -X PUT -H "Content-Type: application/json" -d @contact.json "https://apiv2.imbox.io/api/:apiKey/:userId/contacts/:id"

contact.json​

{
"firstName": "Bosse",
"emails": [{ "email": "bosse@example.com", "isPrimary": true }],
"description": "Moved from old account",
"externalId": "456",
"externalUrl": "http://example.com/efg/456",
"accountId": 46
}

Response​

200 OK​

{}

400 Bad Request​

{
"message": "Validation",
"errors": [
{
"value": "", // The invalid value you provided
"index": 0, // The index of the invalid item, if it's in an array
"label": "firstName" // The name of the invalid property
},
{
"value": "example.com",
"index": 1,
"label": "emails"
}
]
}
{
"message": "accountId not found",
"errors": []
}

409 Conflict​

{
"message": "Conflict",
"error": {
"field": "email",
"row": {
"email": "name@example.com",
"isPrimary": true
}
}
}
{
"message": "Conflict",
"error": {
"field": "phone",
"row": {
"phone": "+46701740635",
"isPrimary": true
}
}
}
{
"message": "Conflict",
"error": {
"field": "unknown",
}
}

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsWrite

Delete contact​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*StringUnique id for the user
id*IntegerId of the contact

Usage​

curl -X DELETE "https://apiv2.imbox.io/api/:apiKey/:userId/contacts/:id"

Response​

200 OK​

{}

404 Not Found​


{
"code": "NotFound",
"message": "Not Found"
}

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsWrite

Get contacts​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*StringUnique id for the user

Query parameters​

NameTypeDescription
idIntegerId of contact
emailStringEmail address of contact
phoneStringPhone number of contact in E.164 format
limitIntegerNumber of contacts to return. Default: 50. Max: 100
afterIntegerCursor for next result set by id

Usage​

curl -X GET "https://apiv2.imbox.io/api/:apiKey/:userId/contacts?limit=2"

Response​

200 OK​

{
"contacts": [
{
"id": 100,
"userId": 200,
"accountId": null,
"crmId": 1,
"description": null,
"externalId": null,
"externalUrl": null,
"firstName": "Arne",
"lastName": "Andersson",
"fullName": "Arne Andersson",
"picture": null,
"title": "CEO",
"activityAt": "2020-01-01T13:00:00.000Z",
"modifiedAt": null,
"createdAt": "2020-01-01T13:00:00.000Z",
"updatedAt": null
},
{
"id": 120,
"userId": 200,
"accountId": null,
"crmId": 1,
"description": null,
"externalId": null,
"externalUrl": null,
"firstName": "Bosse",
"lastName": "Bengtsson",
"fullName": "Bosse Bengtsson",
"picture": null,
"title": "HR manager",
"activityAt": "2020-01-01T13:00:00.000Z",
"modifiedAt": null,
"createdAt": "2020-01-01T13:00:00.000Z",
"updatedAt": null
}
]
"paging": {
"cursor": {
"after": 120
}
},
"next": "https://apiv2.imbox.io/api/apiKey/userId/contacts?limit=2&after=120"
}

paging.cursor.after and next are only provided if there are more results than those that were returned.

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsRead

Create contact note​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*StringUnique id for the user

Usage​

curl -X POST -H "Content-Type: application/json" -d @note.json "https://apiv2.imbox.io/api/:apiKey/:userId/contactNotes"

note.json​

{
"contactId": 1234,
"content": "A note..."
}

Response​

{
"id": 100
}

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsWrite

Delete contact note​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*StringUnique id for the user
id*IntegerThe contact note id

Usage​

curl -X DELETE "https://apiv2.imbox.io/api/:apiKey/:userId/contactNotes/:id"

Response​

200 OK​

{}

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsWrite

Get contact notes​

Get notes

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*StringUnique id for the user

Query parameters​

NameTypeDescription
contactIdIntegerContact to filter by
limitIntegerNumber of contacts to return
afterIntegerCursor for next result set by id

Usage​

curl "https://apiv2.imbox.io/api/:apiKey/:userId/contactNotes?contactId=1&limit=2"

Response​

200 OK​

{
"notes": [
{
"id": 1,
"contactId": 1,
"content": "A note...",
"createdAt": "2020-01-01T13:00:00.000Z"
},
{
"id": 2,
"contactId": 1,
"content": "Anoter note...",
"createdAt": "2020-01-01T13:00:00.000Z"
}
],
"paging": {
"cursors": {
"after": 2
},
"next": "https://apiv2.imbox.io/api/apiKey/userId/contactNotes?contactId=1&limit=2&after=2"
}
}

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsRead

Get contact note​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*StringUnique id for the user
id*IntegerNote id

Usage​

curl "https://apiv2.imbox.io/api/:apiKey/:userId/contactNotes/:id"

Response​

200 OK​

{
"id": 1,
"contactId": 1,
"content": "A note...",
"createdAt": "2020-01-01T13:00:00.000Z"
}

204 No Content​

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsRead

Create account​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*StringUnique id for the user

Body​

NameTypeDescription
name*StringMin 2 characters. Max 50 characters.
descriptionString | null
externalIdString | nullMax 50 characters.
externalUrlString | nullMax 250 characters.
labelsArray<String> | nullReplaces all labels on the account. Case sensitive. If the label does not exist it will not be added to the account.

Usage​

curl -X POST -H "Content-Type: application/json" -d @account.json "https://apiv2.imbox.io/api/:apiKey/:userId/accounts"

account.json​

{
"name": "ImBox Sweden AB",
"externalId": "1234", // optional
"externalUrl": "https://example.com/1234" // optional
}

Response​

200 OK​

{
"id": 100,
"userId": 1,
"crmId": 1,
"externalId": "1234",
"externalUrl": "https://example.com/1234",
"name": "ImBox Sweden AB",
"description": null,
"labels": []
}

400 Bad Request​

{
"code": "BadRequest",
"message": "Bad Request"
}

409 Conflict​

{
"message": "Conflict",
"error": {
"field": "externalId"
}
}

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsWrite

Update account​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*StringUnique id for the user
id*IntegerAccount id

Body​

NameTypeDescription
nameString | nullMin 2 characters. Max 50 characters.
descriptionString | null
externalIdString | nullMax 50 characters.
externalUrlString | nullMax 250 characters.
labelsArray<String> | nullReplaces all labels on the account. Case sensitive. If the label does not exist it will not be added to the account.

Usage​

curl -X PUT -H "Content-Type: application/json" -d @account.json "https://apiv2.imbox.io/api/:apiKey/:userId/accounts/:id"

account.json​

{
"name": "ImBox England Ltd"
}

Response​

200 OK​

{}

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsWrite

Delete account​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*IntegerUnique id for the user
id*IntegerAccount id

Usage​

curl -X DELETE "https://apiv2.imbox.io/api/:apiKey/:userId/accounts/:id"

Response​

200 OK​

{}

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsWrite

Get accounts​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*IntegerUnique id for the user

Query parameters​

NameTypeDescription
limitIntegerNumber of accounts to return
afterIdIntegerCursor for next result set by id

Usage​

curl "https://apiv2.imbox.io/api/:apiKey/:userId/accounts?limit=2"

Response​

200 OK​

{
"accounts": [
{
"id": 1,
"userId": 1,
"crmId": 1,
"externalId": null,
"externalUrl": null,
"name": "ImBox Sweden AB",
"description": "",
"createdAt": "2020-01-01T13:00:00.000Z",
"updatedAt": null,
"labels": []
},
{
"id": 10,
"userId": 1,
"crmId": 1,
"externalId": "1234",
"externalUrl": null,
"name": "ImBox Finland",
"description": null,
"createdAt": "2020-01-01T14:00:00.000Z",
"updatedAt": "2020-01-01T15:00:00.000Z",
"labels": []
}
],
"paging": {
"cursors": {
"afterId": 10
},
"next": "https://apiv2.imbox.io/api/apiKey/userId/accounts?limit=2&afterId=10"
}
}

paging.cursor.after and next are only provided if there are more results than those that were returned.

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsRead

Get account​

Parameters​

NameTypeDescription
apiKey*StringYour API Key
userId*IntegerUnique id for the user
id*IntegerAccount id

Usage​

curl "https://apiv2.imbox.io/api/:apiKey/:userId/accounts/:id"

Response​

200 OK​

{
"id": 1,
"userId": 1,
"crmId": 1,
"externalId": null,
"externalUrl": null,
"name": "ImBox Sweden AB",
"description": null,
"createdAt": "2020-01-01T13:00:00.000Z",
"updatedAt": null,
"labels": []
}

204 No Content​

API key scope access​

Configure API key access in ImBox Admin dashboard.

ScopeAccess
ContactsRead