Domain Management

List Domains:

GET api/domains

Retrieve a list of domains associated with a company.

Headers:

Name
Type
Description
Required

Authorization

String

Bearer token (Bearer {api_token})

Yes

Query Parameters:

Name
Type
Description
Required

company_id

Int

ID of the company to retrieve domains for (optional).

No

Response:

{
  "status": "success",
  "data": [
    {
      "id": 1,
      "name": "example.com",
      "display_name": "Example Domain",
      "company_id": 123,
      "created_at": "2023-10-01T12:34:56Z",
      "updated_at": "2023-10-01T12:34:56Z"
    },
    ...
  ]
}

Create a New Domain

POST /api/domains

Add a new domain to a company.

Headers:

Name
Type
Description
Required

Authorization

String

Bearer token (Bearer {api_token})

Yes

Content-Type

String

application/json

Yes

Body Parameters:

Name
Type
Description
Required

name

String

The domain name to add.

Yes

display_name

String

A display name for the domain.

Yes

company_id

Int

ID of the company to add the domain to (optional).

No

Response:

{
  "status": "success",
  "message": "Domain created successfully.",
  "data": {
    "id": 2,
    "name": "newdomain.com",
    "display_name": "New Domain",
    "company_id": 123,
    "created_at": "2023-10-01T12:35:00Z",
    "updated_at": "2023-10-01T12:35:00Z"
  }
}

Update an Existing Domain

PUT /api/domains/{id}

Modify details of an existing domain.

Headers:

Name
Type
Description
Required

Authorization

String

Bearer token (Bearer {api_token})

Yes

Content-Type

String

application/json

Yes

Path Parameters:

Name
Type
Description
Required

id

Int

The ID of the domain to update

Yes

Body Parameters:

Name
Type
Description
Required

name

String

The updated domain name.

Yes

display_name

String

The updated display name for the domain

Yes

Response:

{
  "status": "success",
  "message": "Domain updated successfully.",
  "data": {
    "id": 2,
    "name": "updateddomain.com",
    "display_name": "Updated Domain",
    "company_id": 123,
    "created_at": "2023-10-01T12:35:00Z",
    "updated_at": "2023-10-01T12:40:00Z"
  }
}

Delete a Domain

DELETE /api/domains/{id}

Remove a domain from a company.

Headers:

Name
Type
Description
Required

Authorization

String

Bearer token (Bearer {api_token})

Yes

Path Parameters:

Name
Type
Description
Required

id

Int

The ID of the domain to delete

Yes

Response:

{
  "status": "success",
  "message": "Domain deleted successfully."
}

Last updated