Create a Collaborator Group

The given API call allows you to create a new collaborator group with specific eligibility requirements. When the call is successful and the Collaborator Group is created, a collaboratorGroupId is assigned to the Collaborator and is returned in the response body of the call. Make note of the collaboratorGroupId as it is needed when adding Collaborators to the group.

To create a Collaborator Group

Endpoint

POST https://api.wingspan.app/payments/collaborator-group

Headers

  • accept: Defines the type of content the client expects. Always set to application/json.
  • content-type: Defines the media type of the request. Always set to application/json.
  • authorization: The authentication token for the API. Prefix with Bearer.

Request Body Parameters

The API accepts the following parameters in the request body:

  • description: (String) A textual representation providing details about the collaborator group.
    Example: Collaborator Group for Construction Project 1.
  • name: (String) The name of the collaborator group.
    Example: "Construction Project 1"
  • eligibilityRequirements: (Array) A list of eligibility requirements a contractor must act on to be considered for a job. Each object in the array must contain the following key:
    • eligibilityRequirementId: (String) The ID of NDAs or contracts.
      Example:
    [
            {
              "eligibilityRequirementId": "123asd"
            },
            {
              "eligibilityRequirementId": "456qwe"
            }
          ]
    

Example Request

curl --request POST \
     --url https://api.wingspan.app/payments/collaborator-group \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'authorization: Bearer <Your bearer token>' \
     --data '
{
  "description": "This is a description of the collaborator group",
  "name": "This is the name of the collaborator group",
  "eligibilityRequirements": [
    {
      "eligibilityRequirementId": "123asd"
    },
    {
      "eligibilityRequirementId": "456qwe"
    },
    {
      "eligibilityRequirementId": "789iop"
    }
  ]
}'

Response

Upon a successful request, the API will return a status code of 200.

Response Body

The response is a JSON object with the following keys:

  • clientId: (String, required) The unique ID associated with the client.
  • collaboratorGroupId: (String, required) The unique ID of the newly created collaborator group.
  • defaultGroup: (Boolean, required) Indicates whether the group is a default group or not.
  • description: (String, required) The description of the collaborator group provided in the request.
  • name: (String, required) The name of the collaborator group provided in the request.
  • eligibilityRequirements: (Array | null) An array of the eligibility requirement IDs provided in the request, or null if none were provided.

Example Response

{
    "clientId": "c1234567890",
    "collaboratorGroupId": "g0987654321",
    "defaultGroup": false,
    "description": "Description of the collaborator group",
    "name": "Name of the collaborator group",
    "eligibilityRequirements": [
        {
            "eligibilityRequirementId": "123asd"
        },
        {
            "eligibilityRequirementId": "456qwe"
        },
        {
            "eligibilityRequirementId": "789iop"
        }
    ]
}

What’s Next

Ensure that you record the collaboratorGroupId as it is used in the next step to assign Collaborators to Collaborator Groups.