Integration with an external account management system¶
An external account management system can create organizations, users and cameras in Watcher, change camera settings and manage access. It tracks enterprise objects and users and links them to Watcher object IDs; Watcher applies the supplied settings and permissions.
Choose a workflow:
- A user's private cameras — create the user and their organization, assign an available preset and connect cameras.
- Access to shared cameras — the organization and cameras already exist; follow the separate example granting access to a selected folder.
In this model:
- Administrator — operates the Watcher installation and connects the external system.
- User — an employee granted access to the site's cameras.
- Account management system — links enterprise objects and users to Watcher organizations, cameras and presets.
Use API v3. Store user, organization and camera IDs returned by Watcher in the external system. Full contracts are in the Client API and Admin API references.
Service account and request authentication¶
For this administrative model, create a separate service account with access_level: "admin". Obtain a JWT through /login or issue a personal API key as described under authentication. The examples below assume these headers:
Authorization: Bearer <token>
Content-Type: application/json
The service account manages users and cameras through Admin API. Organizations are created through Client API with domain organization management permission. In this example the new user owns the organization; ownership and the system administrator role have different permissions in Client API.
For domains without a creation date, or created before January 16, 2026, 08:30:29.622 UTC, an additional login check applies outside the main domain when creating or administratively changing organizations: billing or a name ending in _master is allowed. Account for this when preparing the account.
Folder operations and activation keys require permissions in the corresponding organization. Assign the service account the necessary organization permissions using the user API instructions, or run the user workflow on behalf of the user. The administrative role alone does not bypass these checks.
Create presets¶
A preset defines selected archive and analytics settings. Create it through Admin API:
POST /watcher/admin-api/v3/presets
{
"title": "7-day archive",
"is_adjustable": false,
"dvr": {"expiration": 604800}
}
Save id from the response. is_adjustable: false prevents users from overriding the preset's DVR and analytics settings on a camera. To change camera settings, update the preset itself or assign another preset.
Set up a user¶
This example creates a user, then their organization. Follow the steps in order: the ID from each response is used in the next request.
Step 1. Create the user¶
POST /watcher/admin-api/v3/users
{
"name": "resident-example",
"fullname": "Irina Smirnova",
"password": "ExamplePassword",
"email": "resident@example.com",
"external_id": "account-123"
}
Save id. The login is name; the notification address is email. external_id links the account to the external system's record.
Without organization_id, Admin API adds the user to the target domain's default organization. An explicit organization requires permission to manage its users, even for a Watcher administrator.
Step 2. Create an organization owned by the user¶
POST /watcher/client-api/v3/organizations
{
"title": "Garden Street, apartment 12",
"owner": {"id":15},
"limits": {"streams":4,"users":10}
}
Replace 15 with the user's ID. Save the organization's id. The folder Cameras is created with the organization. The owner receives organization management authority and access to its cameras; separate folder permissions are unnecessary for the owner.
If necessary, remove the user from the default organization with DELETE /watcher/client-api/v3/organizations/{default_organization_id}/users/{user_id}. Confirm they remain a member of their own organization.
Associate the created preset with the created organization. Replace 7 with the organization ID and 42 with the preset ID:
PUT /watcher/client-api/v3/organizations/7/presets
{"preset_id":42}
If several presets are available to an organization, a user with camera management permission can choose among them. Limit the list to presets the user is allowed to select. A Watcher administrator creates and updates presets.
Cameras with Agent¶
For a camera with Agent, obtain an activation key through Client API as a user permitted to manage organization cameras:
POST /watcher/client-api/v3/agent_activation_token
{"organization_id":7,"preset_id":42,"title":"Entrance"}
Take token from the response and use it in the Agent activation procedure. The preset must be available to the organization. If preset_id is omitted, Watcher selects the available default preset or the first available preset; having no available presets causes an error.
After activation, GET /watcher/client-api/v3/agent_activation_token/{token}, sent as the key's creator, returns stream_name. Save it as the camera name. You can also read the user's camera list through GET /watcher/admin-api/v3/streams?organization_id=7.
A user can perform activation in the Watcher interface. If an administrator prepares the keys, the service account needs organization permissions. Do not give administrator credentials to an installer or user.
Camera without Agent¶
For an ordinary camera, the administrator knows the source address in advance. Create it in the user's organization and assign the required preset.
For cameras shared by several users, use the separate selected-folder access workflow. The following request creates a private camera in the organization prepared above.
Add the camera¶
Retrieve the new organization's folders with GET /watcher/client-api/v3/organizations/7/folders?limit=100 and save the required folder's id. The root Cameras folder can be used for a private camera. Below, replace 7 with the created organization's ID, 42 with the preset ID and 12 with the chosen folder ID. If the list returns next, continue with cursor. This request requires the service account's organization permissions described above.
PUT /watcher/admin-api/v3/streams/new-camera
{
"title": "Entrance",
"organization_id":7,
"preset_id":42,
"folder_id":12,
"inputs":[{"url":"rtsp://camera.example.com/main"}]
}
The folder must belong to the organization. Before creation, check that the preset is available to the organization. For an ordinary camera, Watcher generates a name from its title; new-camera in the URL will not become its name. Save name from the response and use it in subsequent requests.
PUT with a nonexistent name creates a camera. Repeating creation with the same arbitrary name can therefore create a duplicate. After a network error, check whether the object exists before creating it again.
Bulk import uses Client API with organization permissions and returns counts only. If the external system needs each new camera's name immediately, create cameras individually.
Add the user¶
The primary account is created in the first step. Additional users can be created through POST /watcher/client-api/v3/users with organization_id, provided the caller manages that organization's users. Membership alone does not grant video access — explicitly grant folder permissions or organization-wide viewing.
An HTTP backend can check passwords in an external system. It does not replace organization and permission configuration.
Change the preset¶
Assign another available preset. In these two examples, replace entrance-example and parking-example with existing camera names from Watcher responses, and 43 with the ID of a preset available to them:
PUT /watcher/admin-api/v3/streams/entrance-example
{"preset_id":43}
For a group of cameras:
POST /watcher/admin-api/v3/streams/multiedit
{"streams":[{"name":"entrance-example","preset_id":43},{"name":"parking-example","preset_id":43}]}
multiedit also supports DVR settings and other fields defined by its schema; use the current Admin API reference. If a listed camera is missing, the request is rejected with 404. Successful application returns 204. Read the settings again after the change and check actual archive recording.
Suspend access¶
Disable the user's account:
PUT /watcher/admin-api/v3/users/15
{"disabled":true}
Watcher deletes its active sessions. To restore access, send disabled: false; the user signs in again.
To stop only a private camera, use PUT /watcher/admin-api/v3/streams/{name} with {"disabled":true}. This affects all consumers of that camera. For a shared camera, revoke the individual user's permissions while keeping the camera available to others.
Disabling an account does not delete separately issued camera sharing tokens. Check and revoke them independently if required by the access revocation policy.
Revoke access and delete objects¶
This independent example removes user 15 from existing shared-camera organization 8. For a user with a private organization, use its ID and first check the consequences of removing its owner in the user API.
DELETE /watcher/client-api/v3/organizations/8/users/15
Membership, organization permissions and folder permissions in this organization are deleted. For complete account deletion, an administrator uses DELETE /watcher/admin-api/v3/users/15.
Change a password by updating the user:
PUT /watcher/admin-api/v3/users/15
{"password":"NewExamplePassword"}
Changing a user's password from another account deletes their sessions. Deleting an organization is a separate cascading operation; first check its contents and consequences using the organization API.
Camera status¶
Read GET /watcher/admin-api/v3/streams?organization_id=7 or GET /watcher/admin-api/v3/streams/{name}. Fetch all pages using next/cursor.
stats contains current camera state, including status and alive when available. disabled in the settings means the camera is administratively disabled; it is not a network reachability indicator. Missing current statistics also does not mean administrative blocking.
After connecting, check settings persistence and video availability separately. A successful settings response does not confirm that the camera is reachable at the supplied address.
Shared cameras: a restricted user¶
This example gives a new user viewing access to a selected shared-camera folder and its subfolders. The organization and cameras already exist. The service account remains the organization owner; do not make the user an owner.
The service account sending these requests must manage users and cameras in this specific organization. The system admin role does not replace those permissions. Use its JWT or personal key following the authentication instructions. All requests below require Authorization: Bearer <token> and Content-Type: application/json.
Here, 7 is the existing shared organization's ID, 12 the selected folder ID and 15 the new user's ID. Replace them with IDs from your installation's responses. Find the organization through GET /watcher/client-api/v3/organizations?limit=100 as described in the organization API.
Step 1. Create an ordinary user in the shared organization¶
POST /watcher/client-api/v3/users
{
"name": "shared-camera-viewer",
"password": "ExampleViewerPassword",
"organization_id": 7,
"access_level": "generic",
"user_permissions": {
"can_edit_users": false,
"can_edit_streams": false,
"can_view_streams": false
}
}
Save the response's id as user_id. This request immediately creates membership in the specified organization. You do not need to create another organization or assign ownership. can_view_streams: true would expose all organization cameras; can_edit_streams: true would also permit camera management and video viewing.
Step 2. Obtain the folder ID¶
GET /watcher/client-api/v3/organizations/7/folders?limit=100
Find the required folder in folders, check its title and parent_id, and save id as folder_id. If next is nonempty, continue with cursor=<next> until the folder is found. The root Cameras folder includes every camera in the organization: select a separate folder containing the required cameras for restricted access. Access also applies to its subfolders.
Step 3. Grant access to the selected folder¶
PUT /watcher/client-api/v3/organizations/7/folders/12/users/15
{
"can_view": true,
"can_view_dvr": true,
"dvr_depth_limit": 0,
"can_use_ptz": false,
"can_use_actions": false
}
This permits live video and the entire available archive, while denying PTZ and camera actions. For live-only access, send can_view_dvr: false. dvr_depth_limit: 0 removes the archive access depth limit; it does not change recording retention.
Step 4. Verify the result¶
Read the permissions again as the service account:
GET /watcher/client-api/v3/organizations/7/users/15
GET /watcher/client-api/v3/organizations/7/folders/12/users/15
In the first response, check that user management, camera management and organization-wide camera viewing are disabled. In the second, check the granted folder permissions. Then sign in as the new user and test a camera in the selected folder and its archive, if allowed. Also check that a camera outside that folder is inaccessible and that the user cannot change camera settings. Test with the new user's token: the service account sees more.
This example assumes a new account without previously assigned permissions. An existing user may retain access through other folders or individual cameras. Removing one permission does not cancel other permissions.
Step 5. Revoke access¶
To remove folder permissions while keeping membership and the account:
DELETE /watcher/client-api/v3/organizations/7/folders/12/users/15
The request removes access to the selected folder and its subfolders. To remove the user completely from the shared organization, use:
DELETE /watcher/client-api/v3/organizations/7/users/15
The second request deletes membership and permissions in this organization. The account itself remains. Repeat the access check as the user; revoking permissions does not mean immediate termination of an already open media session. Complete user deletion is described in the user API.
Verify the integration¶
- Permissions — test the service account's actions in the organization owned by the user. The system role does not replace organization permissions in Client API.
- Repeated requests — prevent duplicate cameras after network failures; store issued names and check state.
- Video access —
can_edit_streamsincludes viewing;can_view_streamscovers every camera in the organization. Use folders for selected cameras. - Suspension — test login by a disabled user and independently check previously issued sharing tokens.
- Preset — read the camera preset again and check the archive after changing it.
- Deletion — distinguish organization removal, account deletion and cascading organization deletion.
Mapping v2 requests to v3¶
Historical paths and model changes are listed in the migration table. Check more than the address: field structure and permission checks changed in v3. All working examples in this article use v3.