Skip to main content
Support

Count articles for several filter sets at once

POST https://api.helpdocs.io/v1/article/count/batch

Example request

Generated
Parameters
curl -X POST https://api.helpdocs.io/v1/article/count/batch \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "filters": [
      {
        "id": "string",
        "article_id": [
          "string"
        ],
        "category_id": [
          "string"
        ],
        "tag": [
          "string"
        ],
        "combine_tags": "string",
        "permission_group": [
          "string"
        ],
        "combine_permission_groups": "string",
        "status": [
          "string"
        ],
        "user_id": [
          "string"
        ],
        "working_copy_user_id": [
          "string"
        ],
        "search_term": "string",
        "is_stale": true,
        "needs_translation": true,
        "outdated_translation": true,
        "has_working_copy": true,
        "language_code": "string",
        "updated_at_before": "string",
        "updated_at_after": "string",
        "combine_filters": "string",
        "working_copy": true,
        "only_deleted": true,
        "include_archived": true
      }
    ]
  }'
curl -X POST https://api.helpdocs.io/v1/article/count/batch \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "filters": [
      {}
    ]
  }'
const url = "https://api.helpdocs.io/v1/article/count/batch";

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "filters": [
      {
        "id": "string",
        "article_id": [
          "string"
        ],
        "category_id": [
          "string"
        ],
        "tag": [
          "string"
        ],
        "combine_tags": "string",
        "permission_group": [
          "string"
        ],
        "combine_permission_groups": "string",
        "status": [
          "string"
        ],
        "user_id": [
          "string"
        ],
        "working_copy_user_id": [
          "string"
        ],
        "search_term": "string",
        "is_stale": true,
        "needs_translation": true,
        "outdated_translation": true,
        "has_working_copy": true,
        "language_code": "string",
        "updated_at_before": "string",
        "updated_at_after": "string",
        "combine_filters": "string",
        "working_copy": true,
        "only_deleted": true,
        "include_archived": true
      }
    ]
  }),
});

const data = await response.json();
console.log(data);
const url = "https://api.helpdocs.io/v1/article/count/batch";

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "filters": [
      {}
    ]
  }),
});

const data = await response.json();
console.log(data);
const url = "https://api.helpdocs.io/v1/article/count/batch";

const options: RequestInit = {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "filters": [
      {
        "id": "string",
        "article_id": [
          "string"
        ],
        "category_id": [
          "string"
        ],
        "tag": [
          "string"
        ],
        "combine_tags": "string",
        "permission_group": [
          "string"
        ],
        "combine_permission_groups": "string",
        "status": [
          "string"
        ],
        "user_id": [
          "string"
        ],
        "working_copy_user_id": [
          "string"
        ],
        "search_term": "string",
        "is_stale": true,
        "needs_translation": true,
        "outdated_translation": true,
        "has_working_copy": true,
        "language_code": "string",
        "updated_at_before": "string",
        "updated_at_after": "string",
        "combine_filters": "string",
        "working_copy": true,
        "only_deleted": true,
        "include_archived": true
      }
    ]
  }),
};

const response = await fetch(url, options);

const data: unknown = await response.json();
console.log(data);
const url = "https://api.helpdocs.io/v1/article/count/batch";

const options: RequestInit = {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "filters": [
      {}
    ]
  }),
};

const response = await fetch(url, options);

const data: unknown = await response.json();
console.log(data);
import requests

url = "https://api.helpdocs.io/v1/article/count/batch"

headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}

payload = {
    "filters": [
        {
            "id": "string",
            "article_id": [
                "string",
            ],
            "category_id": [
                "string",
            ],
            "tag": [
                "string",
            ],
            "combine_tags": "string",
            "permission_group": [
                "string",
            ],
            "combine_permission_groups": "string",
            "status": [
                "string",
            ],
            "user_id": [
                "string",
            ],
            "working_copy_user_id": [
                "string",
            ],
            "search_term": "string",
            "is_stale": True,
            "needs_translation": True,
            "outdated_translation": True,
            "has_working_copy": True,
            "language_code": "string",
            "updated_at_before": "string",
            "updated_at_after": "string",
            "combine_filters": "string",
            "working_copy": True,
            "only_deleted": True,
            "include_archived": True,
        },
    ],
}

response = requests.post(url, headers=headers, json=payload)

print(response.json())
import requests

url = "https://api.helpdocs.io/v1/article/count/batch"

headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}

payload = {
    "filters": [
        {},
    ],
}

response = requests.post(url, headers=headers, json=payload)

print(response.json())
<?php

$ch = curl_init("https://api.helpdocs.io/v1/article/count/batch");

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_TOKEN",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "filters" => [
            [
                "id" => "string",
                "article_id" => [
                    "string",
                ],
                "category_id" => [
                    "string",
                ],
                "tag" => [
                    "string",
                ],
                "combine_tags" => "string",
                "permission_group" => [
                    "string",
                ],
                "combine_permission_groups" => "string",
                "status" => [
                    "string",
                ],
                "user_id" => [
                    "string",
                ],
                "working_copy_user_id" => [
                    "string",
                ],
                "search_term" => "string",
                "is_stale" => true,
                "needs_translation" => true,
                "outdated_translation" => true,
                "has_working_copy" => true,
                "language_code" => "string",
                "updated_at_before" => "string",
                "updated_at_after" => "string",
                "combine_filters" => "string",
                "working_copy" => true,
                "only_deleted" => true,
                "include_archived" => true,
            ],
        ],
    ]),
]);

$response = curl_exec($ch);

print_r(json_decode($response, true));
<?php

$ch = curl_init("https://api.helpdocs.io/v1/article/count/batch");

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_TOKEN",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "filters" => [
            new stdClass(),
        ],
    ]),
]);

$response = curl_exec($ch);

print_r(json_decode($response, true));
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "filters": [
    {
      "id": "string",
      "article_id": [
        "string"
      ],
      "category_id": [
        "string"
      ],
      "tag": [
        "string"
      ],
      "combine_tags": "string",
      "permission_group": [
        "string"
      ],
      "combine_permission_groups": "string",
      "status": [
        "string"
      ],
      "user_id": [
        "string"
      ],
      "working_copy_user_id": [
        "string"
      ],
      "search_term": "string",
      "is_stale": true,
      "needs_translation": true,
      "outdated_translation": true,
      "has_working_copy": true,
      "language_code": "string",
      "updated_at_before": "string",
      "updated_at_after": "string",
      "combine_filters": "string",
      "working_copy": true,
      "only_deleted": true,
      "include_archived": true
    }
  ]
}`)

	req, err := http.NewRequest(http.MethodPost, "https://api.helpdocs.io/v1/article/count/batch", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	data, err := io.ReadAll(res.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(string(data))
}
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "filters": [
    {}
  ]
}`)

	req, err := http.NewRequest(http.MethodPost, "https://api.helpdocs.io/v1/article/count/batch", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	data, err := io.ReadAll(res.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(string(data))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.helpdocs.io/v1/article/count/batch"))
            .header("Authorization", "Bearer YOUR_TOKEN")
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString("""
                {
                  "filters": [
                    {
                      "id": "string",
                      "article_id": [
                        "string"
                      ],
                      "category_id": [
                        "string"
                      ],
                      "tag": [
                        "string"
                      ],
                      "combine_tags": "string",
                      "permission_group": [
                        "string"
                      ],
                      "combine_permission_groups": "string",
                      "status": [
                        "string"
                      ],
                      "user_id": [
                        "string"
                      ],
                      "working_copy_user_id": [
                        "string"
                      ],
                      "search_term": "string",
                      "is_stale": true,
                      "needs_translation": true,
                      "outdated_translation": true,
                      "has_working_copy": true,
                      "language_code": "string",
                      "updated_at_before": "string",
                      "updated_at_after": "string",
                      "combine_filters": "string",
                      "working_copy": true,
                      "only_deleted": true,
                      "include_archived": true
                    }
                  ]
                }"""))
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());

        System.out.println(response.body());
    }
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.helpdocs.io/v1/article/count/batch"))
            .header("Authorization", "Bearer YOUR_TOKEN")
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString("""
                {
                  "filters": [
                    {}
                  ]
                }"""))
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());

        System.out.println(response.body());
    }
}
require "json"
require "net/http"

uri = URI("https://api.helpdocs.io/v1/article/count/batch")

request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer YOUR_TOKEN"
request["Content-Type"] = "application/json"
request.body = JSON.generate({
  "filters" => [
    {
      "id" => "string",
      "article_id" => [
        "string",
      ],
      "category_id" => [
        "string",
      ],
      "tag" => [
        "string",
      ],
      "combine_tags" => "string",
      "permission_group" => [
        "string",
      ],
      "combine_permission_groups" => "string",
      "status" => [
        "string",
      ],
      "user_id" => [
        "string",
      ],
      "working_copy_user_id" => [
        "string",
      ],
      "search_term" => "string",
      "is_stale" => true,
      "needs_translation" => true,
      "outdated_translation" => true,
      "has_working_copy" => true,
      "language_code" => "string",
      "updated_at_before" => "string",
      "updated_at_after" => "string",
      "combine_filters" => "string",
      "working_copy" => true,
      "only_deleted" => true,
      "include_archived" => true,
    },
  ],
})

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

pp JSON.parse(response.body)
require "json"
require "net/http"

uri = URI("https://api.helpdocs.io/v1/article/count/batch")

request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer YOUR_TOKEN"
request["Content-Type"] = "application/json"
request.body = JSON.generate({
  "filters" => [
    {},
  ],
})

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

pp JSON.parse(response.body)
using System.Text;

var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Post, "https://api.helpdocs.io/v1/article/count/batch");
request.Headers.Add("Authorization", "Bearer YOUR_TOKEN");
request.Content = new StringContent(
    """
    {
      "filters": [
        {
          "id": "string",
          "article_id": [
            "string"
          ],
          "category_id": [
            "string"
          ],
          "tag": [
            "string"
          ],
          "combine_tags": "string",
          "permission_group": [
            "string"
          ],
          "combine_permission_groups": "string",
          "status": [
            "string"
          ],
          "user_id": [
            "string"
          ],
          "working_copy_user_id": [
            "string"
          ],
          "search_term": "string",
          "is_stale": true,
          "needs_translation": true,
          "outdated_translation": true,
          "has_working_copy": true,
          "language_code": "string",
          "updated_at_before": "string",
          "updated_at_after": "string",
          "combine_filters": "string",
          "working_copy": true,
          "only_deleted": true,
          "include_archived": true
        }
      ]
    }
    """,
    Encoding.UTF8,
    "application/json");

var response = await client.SendAsync(request);

Console.WriteLine(await response.Content.ReadAsStringAsync());
using System.Text;

var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Post, "https://api.helpdocs.io/v1/article/count/batch");
request.Headers.Add("Authorization", "Bearer YOUR_TOKEN");
request.Content = new StringContent(
    """
    {
      "filters": [
        {}
      ]
    }
    """,
    Encoding.UTF8,
    "application/json");

var response = await client.SendAsync(request);

Console.WriteLine(await response.Content.ReadAsStringAsync());

Responses

{
  "results": [
    {
      "id": "string",
      "count": 1,
      "error": "string"
    }
  ]
}

One count per filter set

Schemas
string

The request was rejected: a required field is missing from the body, or a value in it is not acceptable.

Schemas
{
  "code": 1,
  "err": "string"
}

Authentication failed or no API key was supplied.

Schemas
{
  "code": 1,
  "err": "string"
}

The key lacks read permission, or the account’s plan does not include API access.

Schemas
{
  "code": 1,
  "err": "string"
}

Rate limited. Wait the number of seconds in Retry-After before trying again. X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset say which allowance was spent and when it refills.

Schemas
Generated

Runs a list of filter sets and returns a count for each, so a dashboard can populate many counters in one request instead of one call per counter.

Authentication

    • ApiKeyBearer http bearer

      An API key sent as Authorization: Bearer <key>. A key holds scopes, the same ones OAuth uses, and an operation needs the scope listed for it under OAuth2. A key may also expire, or be revoked or rotated in Settings > API, after which it is refused with a 401.

    • OAuth2 oauth2

      An OAuth 2.0 access token for an app acting on behalf of a HelpDocs user, sent as Authorization: Bearer <token>. The authorization code flow requires PKCE (S256). Each operation names the one scope it needs.

      Scopes read:articles

Request body Required

The filter sets to count. Each entry takes the same filters as the list endpoint, plus an optional id echoed back on the matching result.

application/json BatchCountRequest
  • filters array of ArticleCountFilter Required Nullable

    Null is the same as leaving the field out.

{
  "filters": [
    {
      "id": "string",
      "article_id": [
        "string"
      ],
      "category_id": [
        "string"
      ],
      "tag": [
        "string"
      ],
      "combine_tags": "string",
      "permission_group": [
        "string"
      ],
      "combine_permission_groups": "string",
      "status": [
        "string"
      ],
      "user_id": [
        "string"
      ],
      "working_copy_user_id": [
        "string"
      ],
      "search_term": "string",
      "is_stale": true,
      "needs_translation": true,
      "outdated_translation": true,
      "has_working_copy": true,
      "language_code": "string",
      "updated_at_before": "string",
      "updated_at_after": "string",
      "combine_filters": "string",
      "working_copy": true,
      "only_deleted": true,
      "include_archived": true
    }
  ]
}

Generated from the schema

Responses

200

One count per filter set

application/json ArticleCountBatchResponse
400

The request was rejected: a required field is missing from the body, or a value in it is not acceptable.

text/plain

The failure, as a human-readable message.

  • string

    The failure, as a human-readable message.

401

Authentication failed or no API key was supplied.

application/json Error

An error response.

  • code integer Required

    The HTTP status code.

  • err string Required

    A human-readable description of the failure.

403

The key lacks read permission, or the account’s plan does not include API access.

application/json Error

An error response.

  • code integer Required

    The HTTP status code.

  • err string Required

    A human-readable description of the failure.

429

Rate limited. Wait the number of seconds in Retry-After before trying again. X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset say which allowance was spent and when it refills.

headers

  • Retry-After integer
  • X-RateLimit-Limit integer
  • X-RateLimit-Remaining integer
  • X-RateLimit-Reset integer
application/json Error

An error response.

  • code integer Required

    The HTTP status code.

  • err string Required

    A human-readable description of the failure.

All endpoints