Skip to content

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:

CodeLabel
1Identity
2Passport
3Driving License
4Address Proof
5Birth Certificate
6Others

Subscriber Documents ​

List the subscriber's documents, newest first, including those the ISP uploaded for them.

PropertyValue
EndpointSubscriber Documents
MethodGET
URL/api/v1/subscriber/documents
AuthenticationBearer Token (Subscriber)

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer subscriber-tokenYes

Query Parameters:

ParameterTypeRequiredDescription
pageintegerNoPage number (default 1)
per_pageintegerNoItems 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:

  • name is the document's display name (the file_name given at upload).
  • verified is true once the ISP has verified the document. verification_date is the stored verification time as text (not ISO 8601), or null.
  • uploaded_by_me is true when the subscriber uploaded it, false when 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).

PropertyValue
EndpointUpload Document
MethodPOST
URL/api/v1/subscriber/documents
AuthenticationBearer Token (Subscriber)

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer subscriber-tokenYes

Form Data (multipart/form-data):

ParameterTypeRequiredDescription
file_namestringYesDisplay name for the document, max 36 characters
document_typeintegerYesDocument type code 1 to 6 (see the table above)
filefileYespdf, 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.

PropertyValue
EndpointDownload Document File
MethodGET
URL/api/v1/subscriber/documents/{id}/file
AuthenticationBearer Token (Subscriber)

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer subscriber-tokenYes

Path Parameters:

ParameterTypeRequiredDescription
idintegerYesDocument ID

Request Body: None

Success Response (200 OK):

The file's bytes, served the same way as ticket attachments:

HeaderValue
Content-TypeSet from the stored file's extension (for example image/png, application/pdf); application/octet-stream for anything else
Content-Dispositioninline 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-Optionsnosniff
Content-Security-Policysandbox

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

www.onezeroart.com