{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pitchghost-com/json-schema/pitchghost-com-action-accounts-response-schema.json",
  "title": "ActionAccountsResponse",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pitchghost-com-openapi.json#/components/schemas/ActionAccountsResponse",
  "type": "object",
  "properties": {
    "accounts": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "integrationService": {
                "type": "string",
                "enum": [
                  "linkedin"
                ]
              },
              "accountType": {
                "type": "string",
                "enum": [
                  "PERSONAL",
                  "COMPANY"
                ]
              },
              "integrationId": {
                "type": "string",
                "description": "PitchGhost internal ID for this integration record"
              },
              "accountId": {
                "type": "string",
                "description": "Integration service specific account ID"
              },
              "displayName": {
                "type": "string"
              },
              "handle": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Username or handle where applicable"
              },
              "profilePictureUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "valid",
                  "expired",
                  "invalid"
                ],
                "description": "Whether this account is valid and can be used for actions"
              },
              "access": {
                "type": "string",
                "enum": [
                  "company",
                  "restricted"
                ],
                "description": "Who can act with this account. 'company': every member and every API key. 'restricted': only the members and API keys its linker has allowed."
              },
              "linkedBy": {
                "type": "string",
                "format": "uuid",
                "description": "The team member who linked this account"
              },
              "linkedByName": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Name of the team member who linked this account"
              },
              "usableByThisKey": {
                "type": "boolean",
                "description": "Whether this API key can take actions with the account: it is shared with the whole company (`access: 'company'`), or the member who linked it allowed this key."
              }
            },
            "required": [
              "integrationService",
              "accountType",
              "integrationId",
              "accountId",
              "displayName",
              "handle",
              "profilePictureUrl",
              "status",
              "access",
              "linkedBy",
              "linkedByName",
              "usableByThisKey"
            ],
            "title": "LinkedIn"
          },
          {
            "type": "object",
            "properties": {
              "integrationService": {
                "type": "string",
                "enum": [
                  "twitter"
                ]
              },
              "integrationId": {
                "type": "string",
                "description": "PitchGhost internal ID for this integration record"
              },
              "accountId": {
                "type": "string",
                "description": "Integration service specific account ID"
              },
              "displayName": {
                "type": "string"
              },
              "handle": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Username or handle where applicable"
              },
              "profilePictureUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "valid",
                  "expired",
                  "invalid"
                ],
                "description": "Whether this account is valid and can be used for actions"
              },
              "access": {
                "type": "string",
                "enum": [
                  "company",
                  "restricted"
                ],
                "description": "Who can act with this account. 'company': every member and every API key. 'restricted': only the members and API keys its linker has allowed."
              },
              "linkedBy": {
                "type": "string",
                "format": "uuid",
                "description": "The team member who linked this account"
              },
              "linkedByName": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Name of the team member who linked this account"
              },
              "usableByThisKey": {
                "type": "boolean",
                "description": "Whether this API key can take actions with the account: it is shared with the whole company (`access: 'company'`), or the member who linked it allowed this key."
              }
            },
            "required": [
              "integrationService",
              "integrationId",
              "accountId",
              "displayName",
              "handle",
              "profilePictureUrl",
              "status",
              "access",
              "linkedBy",
              "linkedByName",
              "usableByThisKey"
            ],
            "title": "Twitter"
          },
          {
            "type": "object",
            "properties": {
              "integrationService": {
                "type": "string",
                "enum": [
                  "reddit"
                ]
              },
              "integrationId": {
                "type": "string",
                "description": "PitchGhost internal ID for this integration record"
              },
              "accountId": {
                "type": "string",
                "description": "Integration service specific account ID"
              },
              "displayName": {
                "type": "string"
              },
              "handle": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Username or handle where applicable"
              },
              "profilePictureUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "valid",
                  "expired",
                  "invalid"
                ],
                "description": "Whether this account is valid and can be used for actions"
              },
              "access": {
                "type": "string",
                "enum": [
                  "company",
                  "restricted"
                ],
                "description": "Who can act with this account. 'company': every member and every API key. 'restricted': only the members and API keys its linker has allowed."
              },
              "linkedBy": {
                "type": "string",
                "format": "uuid",
                "description": "The team member who linked this account"
              },
              "linkedByName": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Name of the team member who linked this account"
              },
              "usableByThisKey": {
                "type": "boolean",
                "description": "Whether this API key can take actions with the account: it is shared with the whole company (`access: 'company'`), or the member who linked it allowed this key."
              }
            },
            "required": [
              "integrationService",
              "integrationId",
              "accountId",
              "displayName",
              "handle",
              "profilePictureUrl",
              "status",
              "access",
              "linkedBy",
              "linkedByName",
              "usableByThisKey"
            ],
            "title": "Reddit"
          }
        ]
      },
      "description": "Connected accounts, newest first. `integrationId` is the `accountId` to pass when taking an action."
    },
    "total": {
      "type": "integer"
    }
  },
  "required": [
    "accounts",
    "total"
  ]
}