Appearance
Subscriber - Documents
Base URL:
https://your-domain.com
The signed-in subscriber's documents (ID card, passport and so on): list them, upload a new one and download the file. Paging, the 404 rule and date formats are described under Conventions.
Document types:
| Code | Label |
|---|---|
1 | Identity |
2 | Passport |
3 | Driving License |
4 | Address Proof |
5 | Birth Certificate |
6 | Others |
Subscriber Documents
List the subscriber's documents, newest first, including those the ISP uploaded for them.
| Property | Value |
|---|---|
| Endpoint | Subscriber Documents |
| Method | GET |
| URL | /api/v1/subscriber/documents |
| Authentication | Bearer Token (Subscriber) |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer subscriber-token | Yes |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number (default 1) |
per_page | integer | No | Items per page, 1 to 50 (default 20) |
Request Body: None
Success Response (200 OK):
json
{
"status": "success",
"data": [
{
"id": 412,
"name": "NID front",
"type": { "code": 1, "label": "Identity" },
"verified": true,
"verification_date": "2026-10-21 15:30:12",
"uploaded_by_me": true,
"created_at": "2026-10-20T19:44:03+06:00"
},
{
"id": 398,
"name": "subscriber001_identity",
"type": { "code": 4, "label": "Address Proof" },
"verified": false,
"verification_date": null,
"uploaded_by_me": false,
"created_at": "2026-09-14T12:10:55+06:00"
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 20,
"total": 2
}
}Field notes:
nameis the document's display name (thefile_namegiven at upload).verifiedistrueonce the ISP has verified the document.verification_dateis the stored verification time as text (not ISO 8601), ornull.uploaded_by_meistruewhen the subscriber uploaded it,falsewhen the ISP did.- A type code outside 1 to 6 shows as
Others.
Error Response (401 Unauthorized):
json
{
"message": "Unauthenticated."
}Code Examples:
bash
curl -X GET "https://your-domain.com/api/v1/subscriber/documents?page=1&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$response = $client->request('GET', '/api/v1/subscriber/documents', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'query' => [
'page' => 1,
'per_page' => 20,
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const params = new URLSearchParams({
page: 1,
per_page: 20,
});
const response = await fetch(`${BASE_URL}/api/v1/subscriber/documents?${params}`, {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
response = requests.get(
f"{BASE_URL}/api/v1/subscriber/documents",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
params={
"page": 1,
"per_page": 20,
},
)
data = response.json()
print(data)go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
endpoint := baseURL + "/api/v1/subscriber/documents"
q := url.Values{}
q.Set("page", "1")
q.Set("per_page", "20")
endpoint += "?" + q.Encode()
req, _ := http.NewRequest("GET", endpoint, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.get(format!("{BASE_URL}/api/v1/subscriber/documents"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.query(&[
("page", "1"),
("per_page", "20"),
])
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Upload Document
Upload a document for the subscriber. Allowed unless the ISP turned subscriber document uploads off (see self_service.document_upload in Subscriber Profile Details).
| Property | Value |
|---|---|
| Endpoint | Upload Document |
| Method | POST |
| URL | /api/v1/subscriber/documents |
| Authentication | Bearer Token (Subscriber) |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer subscriber-token | Yes |
Form Data (multipart/form-data):
| Parameter | Type | Required | Description |
|---|---|---|---|
file_name | string | Yes | Display name for the document, max 36 characters |
document_type | integer | Yes | Document type code 1 to 6 (see the table above) |
file | file | Yes | pdf, docx, jpeg or png, max 5 MB |
Success Response (201 Created):
json
{
"status": "success",
"data": {
"id": 413,
"name": "NID back",
"type": { "code": 1, "label": "Identity" },
"verified": false,
"verification_date": null,
"uploaded_by_me": true,
"created_at": "2026-10-24T11:20:37+06:00"
}
}Error Response (403 Forbidden):
json
{
"status": "error",
"message": "Document upload is currently disabled. Please contact support."
}Error Response (422 Unprocessable Entity):
json
{
"message": "The selected document type is invalid.",
"errors": {
"document_type": [
"The selected document type is invalid."
]
}
}Error Response (500 Internal Server Error):
The file could not be stored.
json
{
"status": "error",
"message": "Upload failed. Try again."
}Code Examples:
bash
curl -X POST "https://your-domain.com/api/v1/subscriber/documents" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-F "file_name=NID back" \
-F "document_type=1" \
-F "[email protected]"Download Document File
Download the file of one of the subscriber's documents. The response is the file itself, not JSON.
| Property | Value |
|---|---|
| Endpoint | Download Document File |
| Method | GET |
| URL | /api/v1/subscriber/documents/{id}/file |
| Authentication | Bearer Token (Subscriber) |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer subscriber-token | Yes |
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Document ID |
Request Body: None
Success Response (200 OK):
The file's bytes, served the same way as ticket attachments:
| Header | Value |
|---|---|
Content-Type | Set from the stored file's extension (for example image/png, application/pdf); application/octet-stream for anything else |
Content-Disposition | inline for jpg, png, gif, webp and bmp images; attachment for everything else, SVG included. The file name is the document's name plus the stored extension (for example NID back.jpg) |
X-Content-Type-Options | nosniff |
Content-Security-Policy | sandbox |
Error Response (404 Not Found):
The document is not the subscriber's, or the file is missing on the server.
json
{
"status": "error",
"message": "Not Found"
}Code Examples:
bash
curl -X GET "https://your-domain.com/api/v1/subscriber/documents/413/file" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token" \
-o nid-back.jpg