Saltar al contenido principal
POST
Create an organization (staff only)
Este endpoint solo está disponible para el personal (staff) de ChainPatrol. Las claves de API de clientes y las cuentas de clientes reciben 403 Forbidden.

Descripción general

Crea una nueva organización de cliente exactamente como lo hace el personal de ChainPatrol desde Staff → Organizations → Create en la app. En una sola llamada:
  • crea la organización con los servicios que habilites
  • agrega al propietario (reutilizando un usuario existente con ese email) como OWNER, y al usuario staff que hace la llamada como ADMIN
  • crea los grupos de Assets (activos digitales: URL, dirección, perfil, app, etc.) predeterminados y las marcas iniciales, si las hay
  • crea el sitio web como un asset monitoreado y lo agrega a la Allowlist (lista de permitidos), junto con los assets oficiales que indiques

Autenticación

Autentícate con una clave de API de usuario staff en el encabezado X-API-KEY, o con un token de sesión de staff como Authorization: Bearer <token>. Las claves de API de organización, los usuarios de clientes y las cuentas de servicio de staff de solo lectura se rechazan.

Solicitud de ejemplo

Respuesta

skippedAssets lista los assets que no se agregaron ni se incluyeron en la Allowlist porque están bloqueados actualmente; por ejemplo, un dominio de estafa conocido que se pasó como asset oficial. Revísalos antes de agregar algo a la Allowlist manualmente. brandAssetErrors lista las marcas cuyos assets oficiales no se pudieron agregar. La organización y sus marcas se crean de todos modos; vuelve a agregar esos assets desde la app o con el endpoint Agregar assets de la organización.

Errores

Notas

  • La solicitud se valida con las mismas reglas que el formulario de creación de la app, así que todo lo que la app rechaza también se rechaza aquí.
  • Los ajustes omitidos toman los valores por defecto del formulario de la app: reportes, revisión y detección activados, revisión del cliente desactivada y estado de suscripción PROSPECT. Los demás servicios quedan desactivados a menos que los habilites.
  • Habilitar un servicio automatizado (por ejemplo, isAutomatedReviewingActive) requiere su contraparte manual (isReviewingActive).
  • Los assets oficiales que ya pertenecen a otra organización se omiten en lugar de reasignarse.
  • Los assets que están bloqueados actualmente nunca se agregan a la organización ni a la Allowlist, ya sea que lleguen como el sitio web, en officialAssets o en los officialAssets de una marca. En su lugar, se listan en skippedAssets, y la organización se crea de todos modos.

Autorizaciones

X-API-KEY
string
header
requerido

Your API key. This is required by most endpoints to access our API programatically. Reach out to us at support@chainpatrol.io to get an API key for your use.

Cuerpo

application/json

Create an organization (staff only)

Creates an organization exactly as ChainPatrol staff do from the app: the owner and the calling staff user are added as members, default asset groups and any initial brands are created, and the website and official assets are allowlisted.

Only ChainPatrol staff can call this endpoint, with a staff session or a staff user API key. Organization API keys and customer accounts receive 403.

organization
object
requerido

The organization to create

owner
object
requerido

The customer user who owns the organization

officialAssets
object[]

Official assets of the organization not tied to a brand. Each is created (or claimed when unowned) and allowlisted. Assets owned by another organization are skipped, and currently BLOCKED assets are skipped and reported in skippedAssets

brands
object[]

Initial brands. When provided, at least one is required

Minimum array length: 1

Respuesta

Successful response

Successful operation

organization
object
requerido
owner
object
requerido
brands
object[]
requerido

Brands created with the organization

brandAssetErrors
object[]
requerido

Brands whose official assets could not be added. The organization and brands were still created; add the assets again from the app or API

skippedAssets
object[]
requerido

Website and official assets that were not added or allowlisted because they are currently BLOCKED. The organization was still created; review these assets before allowlisting them

dashboardUrl
string
requerido

Link to the organization's dashboard