For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inBook a demo
HomeGuidesAPI ReferenceGlossary
HomeGuidesAPI ReferenceGlossary
  • API Reference
      • GETGet All Groups
      • POSTCreate Group
      • GETGet Group
      • POSTUpdate Group
      • DELDelete Group
      • POSTGenerate JWT Token
      • POSTAdd Entities
      • POSTRemove Entities
Logo
Sign inBook a demo
API ReferenceEntity Group

Add Entities

POST
https://api.mercoa.com/entityGroup/:entityGroupId/addEntities
POST
/entityGroup/:entityGroupId/addEntities
$curl -X POST https://api.mercoa.com/entityGroup/entg_a0f6ea94-0761-4a5e-a416-3c453cb7eced/addEntities \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "entityIds": [
> "ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
> "ent_21661ac1-a2a8-4465-a6c0-64474ba8181d"
> ]
>}'
1{
2 "id": "entg_a3582b70-fd04-4888-9185-a640ae9048be",
3 "entities": [
4 {
5 "id": "ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
6 "name": "Acme Inc.",
7 "email": "customer@acme.com",
8 "isCustomer": true,
9 "accountType": "business",
10 "profile": {
11 "business": {
12 "legalBusinessName": "Acme Inc.",
13 "taxIDProvided": true,
14 "email": "customer@acme.com",
15 "businessType": "llc",
16 "phone": {
17 "countryCode": "1",
18 "number": "4155551234"
19 },
20 "address": {
21 "addressLine1": "123 Main St",
22 "city": "San Francisco",
23 "stateOrProvince": "CA",
24 "postalCode": "94105",
25 "addressLine2": "Unit 1",
26 "country": "US"
27 },
28 "ownersProvided": true,
29 "taxId": {
30 "ein": {
31 "number": "12-3456789"
32 }
33 }
34 }
35 },
36 "status": "verified",
37 "acceptedTos": true,
38 "isPayor": true,
39 "isPayee": false,
40 "isNetworkPayor": false,
41 "isNetworkPayee": false,
42 "createdAt": "2024-01-01T00:00:00Z",
43 "updatedAt": "2024-01-02T00:00:00Z",
44 "foreignId": "MY-DB-ID-12345"
45 },
46 {
47 "id": "ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
48 "name": "Big Box Store",
49 "email": "vendor@bigboxstore.com",
50 "isCustomer": false,
51 "accountType": "business",
52 "profile": {
53 "business": {
54 "legalBusinessName": "Big Box Store",
55 "taxIDProvided": false,
56 "email": "vendor@bigboxstore.com",
57 "businessType": "publicCorporation",
58 "ownersProvided": false
59 }
60 },
61 "status": "unverified",
62 "acceptedTos": false,
63 "isPayor": false,
64 "isPayee": true,
65 "isNetworkPayor": false,
66 "isNetworkPayee": false,
67 "createdAt": "2024-01-01T00:00:00Z",
68 "updatedAt": "2024-01-02T00:00:00Z",
69 "foreignId": "MY-DB-ID-90909"
70 }
71 ],
72 "metadata": {
73 "key1": "value1"
74 },
75 "foreignId": "your-group-id",
76 "name": "AcmeConglomerate",
77 "emailToName": "acmegroup"
78}
Add entities to an entity group
Was this page helpful?
Previous

Remove Entities

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

entityGroupIdstringRequired
Entity Group ID or Entity Group ForeignID

Request

This endpoint expects an object.
entityIdslist of stringsRequired
List of entity IDs or foreign IDs to add to the group
copyUsersFromboolean or stringOptional

Entity ID / foreign ID of an entity currently in the group to copy users and roles from OR a boolean defining if users should be copied to the new entities.

If not provided or false, users and roles will not be copied. If true, users and roles will be copied from the entity with the most users that has been updated most recently. If a valid ID is provided, users and roles will be copied from the corresponding provided entity in the group.

Note: If users copied, any preexisting users will be left alone, and users with the same foreign ID will not be copied.

filterRoleslist of stringsOptional
List of roles to filter users by. If not provided, all users will be copied. If provided, only users with the provided roles will be copied.

Response

This endpoint returns an object.
idstring
entitieslist of objects
metadatamap from strings to strings
foreignIdstring
namestring
emailToNamestring

Errors

400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
409
Conflict
500
Internal Server Error
501
Unimplemented