API Documentation

Getting started

API is available only to Agency plan subscribers.

WebsitePolicies API

You can use your favorite HTTP/REST library that is available for your programming language to make HTTP calls. You must send JSON payloads in your requests and expect to get JSON responses. Don’t forget to add these headers to every request.

Content-Type: application/json

Use the following base URL for all API endpoints:

https://connect.websitepolicies.com/

Authentication

You can generate an API key in your account by going to the “settings” page and then clicking on the “manage API keys” link. Once the API key is generated, you must include it in the Authorization header and pass it along with your HTTP requests.

Authorization: your_api_key_here

Platforms

List all platforms

GET https://connect.websitepolicies.com/api/platforms

Get a list of all of your platforms (websites and mobile apps).

Request:

curl --request GET \
--url https://connect.websitepolicies.com/api/platforms \
--header "Authorization: your_api_key_here" \
--header "Content-Type: application/json"

Response:

{
  "data": [
    {
      "id": "abcdefg",
      "types": [
        "mobile",
        "website"
      ],
      "name": "Foobar App",
      "website_url": "https://www.foobar.com",
      "documents_url": "https://app.websitepolicies.com/policies/manage/abcdefg",
      "edit_url": "https://app.websitepolicies.com/policies/platforms/edit/abcdefg",
      "documents": "3",
      "created_at": "12-02-2024 11:33",
      "status": "active"
    },
    {
      "id": "abcdefg2",
      "types": [
        "website"
      ],
      "website_url": "https://www.acme.com",
      "documents_url": "https://app.websitepolicies.com/policies/manage/abcdefg2",
      "edit_url": "https://app.websitepolicies.com/policies/platforms/edit/abcdefg2",
      "documents": "5",
      "created_at": "13-03-2024 14:01",
      "status": "active"
    },
 ]
}

Get platform details

GET https://connect.websitepolicies.com/api/platforms/{ID}

Get the details of a single platform based on the ID.

Parameters:

ID: string
Platform ID.

Request:

curl --request GET \
--url https://connect.websitepolicies.com/api/platforms/abcdefg \
--header "Authorization: your_api_key_here" \
--header "Content-Type: application/json"

Response:

{
  "id": "abcdefg",
  "types": [
    "website"
  ],
  "name": "Foobar App",
  "website_url": "https://www.foobar.com",
  "documents_url": "https://app.websitepolicies.com/policies/manage/abcdefg",
  "edit_url": "https://app.websitepolicies.com/policies/platforms/edit/abcdefg",
  "shared_url": "https://app.websitepolicies.com/policies/shared/abcdefg/abcdefg123456789",
  "shared": {
    "items": [
      "acceptable-use-policy",
      "cookie-policy",
      "disclaimer",
      "privacy-policy",
      "refund-policy",
      "terms-and-conditions"
    ],
    "password": "yes",
    "shared_at": "15-03-2024 12:42"
  },
  "documents": "5",
  "created_at": "13-03-2024 14:01",
  "status": "active"
}

Create a platform

POST https://connect.websitepolicies.com/api/platforms

Create a new platform.

Body:

types: array (required)
Type of platform.
    Supported values: website, mobile

mobile name: string
Mobile application name.

website_url: string
Website URL.

Request:

curl --request POST \
--url https://connect.websitepolicies.com/api/platforms \
--header "Authorization: your_api_key_here" \
--header "Content-Type: application/json"
--data "{\"types\":[\"website\",\"mobile\"],\"mobile_name\":\"Foobar App\",\"website_url\":\"https://www.foobar.com\"}"

Response:

{
  "message": "Platform created.",
  "data": {
    "id": "abcdefg"
  }
}

Update platform details

PUT https://connect.websitepolicies.com/api/platforms/{ID}

Update a platform based on the ID.

Parameters:

ID: string
Platform ID.

Body:

types: array (required)
Type of platform.
    Supported values: website, mobile

mobile name: string
Mobile application name.

website_url: string
Website URL.

Request:

curl --request PUT \
--url https://connect.websitepolicies.com/api/platforms/abcdefg \
--header "Authorization: your_api_key_here" \
--header "Content-Type: application/json"
--data "{\"types\":[\"website\",\"mobile\"],\"mobile_name\":\"Foobar App\",\"website_url\":\"https://www.foobar.com\"}"

Response:

{
  "message": "Platform updated.",
  "data": {
    "id": "abcdefg"
  }
}

Share a platform

PUT https://connect.websitepolicies.com/api/platforms/{ID}/share

Share a platform based on the ID.

Parameters:

ID: string
Platform ID.

Body:

items: array (optional)
Items you'd like to share. Don't include it if you want to share all available items or set it to an empty array to reset existing shared items to all.
    Supported values:
        cookie-consent-banner
        dsar
        acceptable-use-policy
        cookie-policy
        disclaimer
        dmca-policy
        guest-post-agreement
        privacy-policy
        refund-policy
        terms-and-conditions

password: string (optional)
Your preferred password. Don't include it if you don't want to set or change existing password or set it to a blank value to remove existing password.

Request:

curl --request PUT \
--url https://connect.websitepolicies.com/api/platforms/abcdefg/share \
--header "Authorization: your_api_key_here" \
--header "Content-Type: application/json"
--data "{\"items\":[\"cookie-policy\",\"privacy-policy\"],\"password\":\"hello there\"}"

Response:

{
  "message": "Platform shared.",
  "data": {
    "id": "abcdefg"
  }
}

Disable platform sharing

DELETE https://connect.websitepolicies.com/api/platforms/{ID}/unshare

Disable platform sharing based on the ID.

Parameters:

ID: string
Platform ID.

Request:

curl --request PUT \
--url https://connect.websitepolicies.com/api/platforms/abcdefg/unshare \
--header "Authorization: your_api_key_here" \
--header "Content-Type: application/json"

Response:

{
  "message": "Platform sharing disabled.",
  "data": {
    "id": "abcdefg"
  }
}

Delete platform

DELETE https://connect.websitepolicies.com/api/platforms/{ID}

Delete a platform based on the ID.

Parameters:

ID: string
Platform ID.

Request:

curl --request DELETE \
--url https://connect.websitepolicies.com/api/platforms/abcdefg \
--header "Authorization: your_api_key_here" \
--header "Content-Type: application/json"

Response:

{
  "message": "Platform deleted.",
  "data": {
    "id": "abcdefg"
  }
}