1. Introduction
This section is non-normative.
The Open Federated Database (OFD) protocol is an HTTP application protocol through which independent network services learn from observations that other services have made about the entities that contact them. A service that participates may operate a host, which is an HTTP interface to a federated database of records about the entities the host has encountered. Alternatively, a service may participate by querying a host operated by another provider as a downstream consumer, or by contributing records to such a host as a client.
The protocol is semi-decentralized: there is no central authority, required registry, or shared server. What makes OFD federated is that independent hosts implement a common protocol and independently identify the same entities using entity addresses and deterministic entity identifiers. A host is not required to replicate another host’s database.
Participation does not require a host to disclose information beyond the entity
identifiers and records it chooses to share. An entity identifier, such as
john@example.com, can itself be personal information; a host SHOULD consider
that risk when deciding what to expose.
1.1. Overview
A service on the internet—a mail server, a firewall, an application—is contacted by entities it may not know. It cannot tell from a request alone whether an entity is trustworthy or abusive, so it must choose whether to serve the request, block it, or filter its content. OFD gives services the information to make that choice.
The records of a federated database are built and managed by operators acting through clients: software that performs the operations of an operator automatically, according to its configuration. The services that query the records of a host before deciding how to treat an entity are its downstream consumers. They read the database; they are never required to write to it.
1.2. How the Database Is Used
A downstream consumer uses the federated database to decide, for each entity it encounters, whether to serve, block, or filter the request. Figure 1 illustrates the flow.
The flow works as follows. When a service is contacted by an unknown entity, it queries one or more hosts for the records of that entity before handling the request. If the entity is subject to an active blacklist record, the service blocks the request outright; otherwise, if the reputation the host assigns to the entity indicates a high risk, the service filters or flags the content instead of serving it unmodified; otherwise, the service serves the request normally.
Two properties of this flow are essential. First, the decision rests with the service, not with the federated database: a host only reports what it knows, and a service is free to weigh the records of several hosts, apply its own policy to reputation scores, and combine the database with its other signals. Second, the flow is not one-directional: a service that encounters abuse may push its own observations into the federated database—as evidence, reports, or blacklist records—so that the next service to encounter the same entity can act on them. Contributing is optional, and never required of a service that only reads.
2. Scope
This specification is normative for three kinds of products:
-
conforming hosts, which operate a federated database and expose it over HTTP or HTTPS;
-
conforming clients, which interact with a host as an operator and build the data of the database; and
-
conforming downstream consumers, which query the records and telemetry of a host before deciding whether to block an entity or filter its content, without contributing records of their own.
The requests and responses defined by this specification are normative and interchangeable between implementations: a conforming host MUST understand and produce them as defined here, and a conforming client MUST be able to rely on them regardless of the technology a host uses internally.
The following are explicitly out of scope: the internal storage, database design, deployment technology, and content classification mechanism of a host, since an implementation MAY use any technology so long as the requests and responses it produces conform to this specification; the definition of what content is malicious, since hosts define their own policies, tags, and assessments; the user interfaces and operational tooling around a host; and inter-host synchronization and replication, since this specification defines only the interface a host exposes, and the ways in which hosts consume each other’s data as downstream consumers are the same interfaces, used openly.
3. Conformance
The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, NOT RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
All text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. Examples in this specification are introduced with the words "for example" or are set apart from the normative text, and informative notes begin with the word "Note".
3.1. Classes of Products
A conforming host is any implementation that exposes the OFD interface and fulfills all the requirements identified in this specification for hosts.
A conforming client is any implementation that interacts with one or more conforming hosts and fulfills all the requirements identified in this specification for clients.
A conforming downstream consumer is any implementation that queries one or more conforming hosts for the records and telemetry of an entity and fulfills all the requirements identified in this specification for downstream consumers.
4. Terminology
- access token
-
An opaque, 32-character string that authenticates an operator. A request presents it in the
Authorizationheader using theBearerscheme [RFC6750]. - actor
-
An individual, service, or automated program that interacts with a service. An entity is the identifier under which a service observes an actor; an entity identifier does not by itself establish the actor’s real-world identity.
- audit log
-
The chronological record of the operations performed on a federated database. Each entry records the type of operation, a message, the timestamp, and references to the affected records—operator, entity, blacklist, evidence, file attachment, and report. A host designates each entry type as public or private.
- authentication
-
The process by which a host verifies the identity of an operator from the access token presented in a request.
- base URL
-
The URL at which a host serves the OFD interface. Every path defined in this specification is relative to the base URL of the host.
- blacklist record
-
A decision by an operator to block an entity. A blacklist record has an incident type and is either temporary, expiring at a given time, or permanent. It is active until an operator lifts it or its expiry passes, MAY reference the report supporting the decision, which MAY concern another entity, and an entity MAY have any number of blacklist records.
- bot operator
-
An operator whose configuration marks it as an automated program, such as a bot that monitors a chat service. The evidence and reports a bot operator submits are automated, as specified in § 6.2.1 Automated Records.
- canonical entity address
-
An entity address after applying the canonicalization rules in § 8.2 Entity Address Canonicalization. It is the input to the deterministic SHA-256 identifier.
- client
-
Software that interacts with a host as an operator: a bot, monitoring program, or integration that performs the operations of an operator automatically, according to the configuration set by its maintainer or by the administrators using it. Clients build the data of the federated database: they monitor activity, submit entities, evidence, reports, and file attachments, and MAY submit content for scanning and act on the results of the scan.
- client permissions
-
The permission group that authorizes an operator to submit information to the federated database: registering and updating entities, setting and clearing entity relationships, submitting evidence and reports, uploading file attachments, and scanning content.
- collection
-
A resource of a host that groups the records of one kind: for example, the entity registry, or the records of evidence or of reports.
- concern
-
A kind of abuse that a requester asks a host to assess when scanning content or querying an entity, expressed as one of the incident type values. A host considers only the concerns of a request when deriving the classification, risk score, and suggested action it returns, so that a service can ignore kinds of abuse it does not act on.
- content type
-
The kind of content carried by a ContentInput object, such as a message, an email, a web page, a DNS name, or a URL. It tells a host how to interpret the content and which descriptive context accompanies it.
- downstream consumer
-
A service that queries the records and telemetry of a host before deciding whether to block an entity or filter its content.
- entity
-
The identifier under which a service observes an actor. An entity record contains the entity’s entity address, host-local UUID, deterministic SHA-256 identifier, metadata, reputation, and relationships.
- entity address
-
The canonical, protocol-independent representation of an entity. A named entity address has the form
local-part@entity-host; a host entity address consists of the entity host alone. - entity host
-
The namespace or service component of an entity address. It identifies the service responsible for interpreting an entity’s local part and is independent of the host that stores the entity record.
- entity identifier
-
One of three forms that resolves an entity record: an entity address, its deterministic SHA-256 identifier, or the UUID assigned by the host storing that record. The address and SHA-256 identifier have universal scope; the UUID is host-local.
- entity registry
-
The collection of entity records a host keeps about the entities it has encountered.
- entity relationship
-
A link between two entities in the entity registry: an alternative account of the same actor, a proxy relaying for the target, or a child entity dependent on the target.
- evidence
-
Information submitted about an entity to support deciding whether the entity should be trusted. Evidence contains text content, its content type and context, a note, a tag, an automated flag, an optional reference to a report, an optional classification flag, an optional set of file attachments, a confidentiality flag, and the timestamps of its creation and last update. A confidential evidence record is visible only to an operator with management permissions. Other records MAY expose its UUID as an opaque reference; that reference does not grant access to the evidence record.
- federated database
-
The collection of records a host keeps about the entities it has encountered: the entity registry, evidence, blacklist records, reports, file attachments, operators, and the audit log.
- file attachment
-
A record of a file uploaded as part of the evidence of an entity, described by its file name, size, and media type. Each attachment belongs to one evidence record, and an evidence record MAY have any number of attachments.
- host
-
A service that operates a federated database and serves it over HTTP or HTTPS at its base URL: the provider of the database. The services that query the database are its downstream consumers.
- management permissions
-
The permission group that authorizes an operator to manage the records of the federated database. Management permissions inherit all client permissions. In addition, they authorize the deletion of records, the management of blacklist records and of the whitelist, the clearing of reputation, access to confidential evidence, the classification of evidence and its linking to reports, and the assignment and closure of reports.
- method
-
A discrete operation exposed by a host, identified by a method name and bound to a route pattern paired with an HTTP request method.
- method name
-
The unique lower camel case identifier of a method, such as
blacklistEntityorgetEvidenceRecord. - operator
-
An account on a host used to manage the federated database on behalf of a service. An operator has a name, a disabled flag, an access token, its permission groups, and a configuration of settings such as automatic report assignment and whether it is a bot operator.
- operator permissions
-
The permission group that authorizes an operator to manage the operators of the host: creating, deleting, enabling, and disabling operator accounts, modifying their names and permission groups, generating access tokens, managing their configuration, and updating evidence tags. Operator permissions do not inherit client permissions or management permissions.
- permission group
-
A set of privileges granted to an operator. This specification defines three permission groups: client permissions, management permissions, and operator permissions.
- record
-
A discrete item stored in a federated database: an entity, an operator, evidence, a blacklist record, a report, a file attachment, or an audit log entry. Every record is identified by a UUID.
- report
-
A record made against an entity documenting an incident. A report contains the incident type, a message, the operator that submitted it, the entity it reports (which MAY be anonymous), an optionally assigned operator, an opened flag, an automated flag, and the timestamps of its creation and last update. A report is opened when created and closed when resolved.
- reputation
-
An integer score assigned to an entity by a host. A host MUST constrain the score to the inclusive range −1000 through 1000. A new entity has a default reputation of 0. Lower values indicate that the host considers the entity more likely to be abusive; higher values indicate greater trust.
- resource
-
A distinct item of information exposed by a host at a path of its base URL: a collection, a single record, or a derived view such as a search result.
- risk score
-
A numeric, content-specific score produced by a host while scanning. It starts at 50 before the host applies its own factors. Higher values indicate greater risk; lower values indicate lower risk.
- root access token
-
A server-level secret configured by a host that authenticates the root operator.
- root operator
-
The built-in operator of a host authenticated by the root access token; the administrator of the federated database.
- semi-decentralized
-
Describing a system in which participants operate independent services that interoperate through a shared, open protocol rather than a central authority.
- service
-
A network service on the internet—a mail server, a firewall, an application—that is contacted by entities and that may operate a host, contribute records to hosts as a client, or query them as a downstream consumer.
- system operator
-
The reserved operator of a host used for automatic operations.
- telemetry
-
The statistics and configuration a host exposes about its federated database: how many records it holds and which domains it exposes publicly. Downstream consumers use telemetry to learn what is available on a host without authentication.
- telephone entity
-
A named entity identified by a telephone number, whose entity host is
e164.arpa, as specified in § 8.3 Telephone Entities. A telephone entity is hidden from unauthenticated requests that do not already know its number. - whitelist
-
A trust mark that a host applies to an entity it considers non-malicious. A host MUST NOT adjust the reputation of a whitelisted entity, whether the adjustment would result from a blacklist record against the entity or an entity related to it, the classification of a report, or scanning activity. Whitelisting does not prevent an operator from blacklisting the entity or clearing its reputation.
5. Architecture
The OFD protocol involves four parties, defined in § 4 Terminology: a host operates a federated database; an operator manages the database on behalf of a service; a client acts as an operator to build the records of the database automatically; and a downstream consumer queries the records before deciding how to treat an entity.
The OFD interface exposed by a host comprises three surfaces. The information surface describes the host itself—its identity, the interface version it implements, the public-accessibility information it publishes, and how many records its federated database holds—and is always public. The data surface is the federated database itself: the collections of records and the operations that read and modify them, with access governed by host configuration and the permissions of the requester. The analysis surface queries and inspects content beyond the stored records, including search across the federated database and content scanning; how a host derives the classification of scanned content is internal to the host and not part of the interface.
The protocol is stateless. A host MUST NOT require a client to maintain a session, and MUST treat every request as independent, authenticated on its own merits as specified in § 9.6 Authentication.
5.1. Versioning
The OFD interface is identified by an interface version of the
form MAJOR.MINOR, where MAJOR is the major version and
MINOR is the minor version, each a non-negative decimal integer
without leading zeros. This specification defines interface version
2.2. A host publishes the interface version it implements in
the api_version member of its ServerInformation object, as
specified in § 10.1.1 Get Server Information.
A minor version is backward compatible with every earlier minor version of the same major version. A minor version can add methods, optional parameters, members of objects returned in responses, values of the sets of values defined by this specification, and optional capabilities of a host; it does not remove or rename existing methods, parameters, or members, change their types or meaning, or make an optional parameter required. A conforming host that implements a given interface version therefore also serves conforming clients and conforming downstream consumers written for any earlier minor version of the same major version.
A change that cannot be made in a backward compatible way increments the major version and resets the minor version to zero. Implementations of different major versions are not expected to interoperate.
Two interface versions are compared by their major versions and then by their
minor versions, each compared as an integer, so that 1.10 is later
than 1.9. A client or downstream consumer:
-
SHOULD retrieve the interface version of a host through the Get Server Information method before relying on behavior introduced after version
2.0. -
MUST NOT use a method, parameter, or capability introduced in a later minor version than the one the host reports.
-
SHOULD NOT interact with a host that reports a major version it does not implement.
-
MUST ignore members of objects returned in responses that it does not recognize, so that members added by a later minor version do not prevent it from processing the response.
-
MUST NOT fail to process a response because a member carries a value, drawn from a set of values, that it does not recognize. It SHOULD treat an unrecognized incident type as
OTHER.
Note: A host that
implements an earlier minor version does not recognize parameters introduced in
a later one, and may reject or ignore them. For example, a host that implements
version 2.0 does not recognize the files introduced in version
2.1 for the Scan Content method, and may reject a request that
supplies them or process the request as though they were absent. Likewise, a
host that implements version 2.1 rejects a ContentInput object
carrying the file_urls member introduced in version
2.2.
Note: A host that
does not publish a member of the ServerInformation object introduced in a
later minor version, such as max_scan_files, implements an earlier
minor version.
6. Data Model
The federated database of a host is a set of records organized into collections. Each collection groups the records of one kind; each record is identified by a UUID assigned by the host when the record is created, and carries the timestamps of its creation and, where applicable, last update.
The following record kinds are defined by this specification.
- Entity registry
-
Tracks what the host knows about an actor: its identifiers, metadata, whether it is whitelisted, its reputation, its entity relationships, and timestamps.
- Operators
-
The accounts that manage the database; an operator record contains a name, a disabled flag, the permission groups granted to the operator, and its configuration.
- Evidence
-
Carries the information collected about an entity: text content, a note, a tag, an optional reference to a report, an optional classification flag, a confidentiality flag, an automated flag, optional file attachments, and timestamps.
- Blacklist records
-
Record a decision to block an entity; each has an incident type and is either temporary, expiring at a given time, or permanent. It is active until lifted by an operator or its expiry passes, MAY reference the report supporting the decision, and an entity MAY have any number of them.
- Reports
-
Records made against an entity documenting an incident: the type of the incident, a message, the operator that submitted it, the entity being reported, an optionally assigned operator, an opened flag, an automated flag, and timestamps. Reports that a host creates automatically under its own policy, and reports submitted by a bot operator, have their
automatedmember set to true. - File attachments
-
Records of files uploaded as part of the evidence of an entity; each attachment belongs to one evidence record, and an evidence record MAY have any number of attachments.
- Audit log
-
The chronological record of the operations performed on the federated database; every entry records the type of operation, a message, the timestamp, and the records affected.
The record kinds work together. Blacklist records and reports are made against the entities of the entity registry; evidence documents what was observed about an entity and MAY reference a report; file attachments belong to evidence; and audit log entries point at the records they affected. Every change to the federated database—whether by an operator or by automation—is recorded in the audit log, so the history of an entity can be traced after the fact.
A host keeps the history of its federated database: every record preserves when it was created and last changed, and the audit log preserves what was done to the database and by whom, even after the affected records change or are removed. A host publishes telemetry about its federated database, including record counts and any public-accessibility information it chooses to expose, through the information surface. A downstream consumer can use this information to determine what is available.
6.1. Deletion of Records
Deleting a record does not by itself define what happens to the records that refer to it. When a record is deleted, a host MAY also delete the records that depend on it, such as the evidence of a deleted entity, or MAY retain them; a retained record keeps the UUID of the deleted record, or, in a member whose definition permits null, MAY have that member set to null. A client or downstream consumer MUST therefore expect that following a reference to a record yields a not-found error (HTTP 404). The audit log retains its entries for the deleted record.
A host that deletes a file attachment record, including one deleted together
with its evidence, MUST also delete the stored file. A file attachment that
a host retains after its evidence is deleted, whose evidence member
is therefore null, has no evidence from which to inherit its confidentiality: a
host MUST treat it as the attachment of confidential evidence, and it remains
deletable with the Delete Attachment method.
6.2. Population of the Database
Clients build the data of a federated database. They monitor activity, submit entities, evidence, and reports, and raise blacklist records when their configuration calls for it. Optionally, a client may also collect information actively and silently—for example, the content exchanged in a chat channel it monitors—and submit that content to the host to be scanned, then take actions depending on the results of the scan.
A host MAY create reports automatically under a policy it defines. The conditions for automatic report creation, the supporting evidence it records, and any subsequent assignment are internal to the host.
A host MAY classify content with any internal mechanism it chooses. The classification mechanism is not part of the OFD interface: a scan request carries content in, and a scan response carries the results out, but how a host derives the classification—whether from the past data it has accumulated, from the reputation of the involved entities, or from any other analysis—is internal to the host, MAY differ between hosts, and is not defined by this specification. The content type of submitted content tells a host how to interpret it, and the concerns of a request tell it which kinds of abuse the requester wants assessed; how a host assesses each content type and concern is likewise internal to the host. What a client submits is an assertion that a host verifies where it can, as specified in § 7.1 Client Assertions.
6.2.1. Automated Records
A record of evidence or a report is automated when no person decided
to create it: when the host created it itself, or when a bot operator
submitted it. A host MUST set the automated member of an
EvidenceRecord or ReportRecord object to true for evidence and reports
that it creates itself, and for evidence and reports submitted by an operator
whose configuration has is_bot set to true at the time of
submission, whatever the request supplies; it MUST set the member to false for
every other record. An automated report is otherwise an ordinary report.
Automated evidence has not been reviewed by a person and can contain private communications collected by a program. A host MUST create automated evidence as confidential, whatever the request supplies. An operator with management permissions MAY afterwards make it non-confidential with the Update Evidence Confidentiality method, as specified in § 10.7.9 Update Evidence Confidentiality, for example after reviewing it, unless that method requires it to remain confidential; the evidence remains automated.
Changing the configuration of an operator does not change the
automated member of records created before the change.
Evidence that a host creates itself, including evidence recording scanned content in support of an automated report, MUST be confidential when it is associated with a telephone entity, when the report it supports is against a telephone entity, or when the content was submitted with a telephone entity as its author. The message of an automated report against a telephone entity MUST NOT include the entity address.
7. Host Policy
OFD standardizes the representation and exchange of records, not the policy by which a host derives them. A host determines, among other things, what causes reputation changes, how content is classified, when reports or blacklist records are created, how long records are retained, what information is public, and how automated systems operate. A host SHOULD document these policies so that downstream consumers can evaluate the meaning and reliability of its records.
This version of OFD does not standardize record replication, imported-record provenance, or a source field. A record returned by a host is that host’s local record and does not express whether the host learned information directly or from another host. A consumer seeking independent assessments MUST query each host directly and MUST NOT infer independent observations from matching records returned by different hosts.
7.1. Client Assertions
Authentication establishes which operator submitted information; it does not establish that the information is accurate. The content and context of a ContentInput object, metadata, evidence, reports, and entity relationships submitted by a client are assertions made by that operator. A host decides how far it relies on each assertion, and MAY weigh it by the operator that made it, for example by the operator’s permission groups or by the history of its submissions recorded in the audit log.
A host SHOULD determine for itself what it is able to determine for itself. Where an assertion concerns a network resource—the addresses to which a DNS name resolves, the content served at a URL, or the target of a redirect—a host SHOULD resolve or retrieve the resource itself, subject to § 12.5 Remote Retrieval, before it relies on the assertion to create or modify a record, and MUST rely on its own observation where that observation differs from the assertion. A host MAY use an assertion that it has not verified to produce the result it returns to the requester, and then indicates this as specified in § 10.2.2.3 Detection object.
A host MUST NOT decrease the reputation of an entity, or create a
blacklist record or an automated report against it, solely because
clients submitted the entity, or content naming it, for scanning, regardless of
how often they did so. Submitting content for scanning is not an observation of
abuse by the entities it names: content of the HOSTNAME content type, for example, asserts only that a device looked up the name. A host
MAY create records from the results of its own analysis of submitted content,
as permitted by § 6.2 Population of the Database, and SHOULD document under § 7 Host Policy the
sources on which such analysis relies, such as third-party filter lists.
8. Identification of Entities
OFD separates universal entity identity from host-local record identity. The entity address is the canonical representation of an entity across OFD hosts. The SHA-256 identifier is deterministically derived from that canonical address. A UUID identifies the record that one specific host created for the entity.
The entity host in an entity address identifies the namespace in which the
local part has meaning. It is not the OFD host that stores or serves the record.
For example, 123456789@telegram.org may be stored by
https://ofd.example.com; creating that record grants the OFD host no authority
over telegram.org or the entity. Likewise, 15550123456@e164.arpa identifies
a telephone number within the namespace of international telephone numbers, as
specified in § 8.3 Telephone Entities.
8.1. Entity Identifier Forms
The following forms address an entity:
| Identifier | Scope | Purpose |
|---|---|---|
| Entity address | Universal | The canonical identity of the entity. |
| SHA-256 identifier | Universal and deterministic | A compact, independently derivable representation of the canonical entity address. |
| UUID | Host-local | The identity of an entity record within the host that assigned it. |
A UUID MUST NOT be assumed to identify the same entity across hosts. Hosts that implement the same canonical entity address MUST derive the same SHA-256 identifier. A downstream consumer MAY query multiple hosts with the same entity address and compare their independent records; equal entity identity does not imply equal reputation, evidence, or authority.
8.2. Entity Address Canonicalization
For a named entity, the canonical entity address is the UTF-8 [RFC3629] string
local-part@entity-host. The local part is case-sensitive and MUST
contain only ASCII letters, digits, ., _,
%, +, or -.
The entity host MUST NOT contain whitespace, a port, a path, a query, a fragment, or a trailing dot. A DNS [RFC1034] entity host MUST use lowercase ASCII labels; an internationalized domain name is represented by its A-labels [RFC5890]. An IPv4 entity host MUST use four decimal octets separated by dots, with no leading zero except for the value zero. An IPv6 entity host MUST use its lowercase compressed textual representation [RFC5952]. A host entity uses the canonical entity host string alone. A host MUST reject an entity address that is not already in canonical form with HTTP 400.
The registrable domain of a DNS entity host is its public suffix, as
determined by the Public Suffix List, plus
the one label that precedes it; for example, the registrable domain of both
sub.example.com and example.com is
example.com, and that of a.b.example.co.uk is
example.co.uk. An entity host that is itself a public suffix, and an
IPv4 or IPv6 entity host, has no registrable domain.
As the one exception to the rejection of addresses not in canonical form, a DNS
entity host whose first label is www denotes the same entity as the
host without that label, provided the remainder still has a registrable domain. A host MUST remove the leading
www. label, rather than reject the address, before storing the entity
address or deriving its SHA-256 identifier, so that www.example.com
and example.com address the same entity. The removal is repeated
while the host still begins with a www label that can be removed,
so that www.www.example.com also becomes example.com.
The label MUST NOT be removed when the remainder has no registrable domain, as
in www.com or www.co.uk. Any other subdomain, such as
sub.example.com, is a distinct entity.
8.3. Telephone Entities
A telephone entity is a named entity whose entity host is
e164.arpa and whose local part is a telephone number in the
international format of ITU-T
Recommendation E.164. The canonical local part consists of the country code
followed by the national significant number, written as 1 through 15 ASCII
digits of which the first is not 0, with no leading +,
international prefix, spaces, or punctuation. For example, the number written
+1 (555) 012-3456 is the entity 15550123456@e164.arpa.
The + is omitted because it denotes a space in query strings and
form-encoded bodies [URL]. A host MUST reject, with a client error
(HTTP 400), an entity address with the entity host e164.arpa whose
local part is not in this form, and MUST reject the registration of
e164.arpa itself as a host entity, since it denotes the numbering
namespace rather than an actor. A host MUST also reject, with a client error
(HTTP 400), an entity address whose entity host is a subdomain of
e164.arpa, such as the ENUM domain
6.5.4.3.2.1.5.5.5.1.e164.arpa of a number, since it would identify
a telephone number outside the canonical form of a telephone entity.
The entity host e164.arpa serves only as a namespace. A telephone
entity is not the domain that ENUM [RFC6116] derives from the number, and
identifying it implies no DNS lookup. A sender that has no E.164 number, such as
an SMS short code or an alphanumeric sender ID, is not a telephone entity.
Telephone numbers identify people, and are few enough that every number can be
enumerated. A host therefore hides telephone entities from requests that do
not already know the number, unless it publishes
public_telephone_entities as true in its ServerInformation
object. A host SHOULD NOT publish it as true. Unless it does, for a request that
is not authenticated, the host:
-
MUST NOT return the EntityRecord of a telephone entity, except to a request that identifies that entity by its entity address or SHA-256 identifier, through the Get Entity Record and Query Entity methods, or to a Scan Content request whose content contains the number or whose
authoris that entity. It therefore omits telephone entities from List Entities, Search Entities, Top Threats, the results of the Search method, therelated_entitiesof an EntityQueryResult, and theparent_entityof a ResolvedEntity. -
MUST respond to a request that identifies a telephone entity by its UUID as though the entity did not exist (HTTP 404), since the UUIDs of entities appear in other records.
-
MUST NOT match the query of any search method against the address of a telephone entity, so that a search cannot reveal which numbers the host holds records about.
-
MUST set the
metadatamember of a telephone entity to null. -
MUST NOT include the entity address of a telephone entity in the message of an audit log entry.
-
MUST omit from the
active_blacklistsof an EntityQueryResult the blacklist records of telephone entities other than the queried entity, since theirentitymember would reveal that the host holds records about them.
A host MAY apply the same restrictions to authenticated operators that do not hold management permissions.
Evidence about a telephone entity is likely to contain private messages. Evidence that a host creates itself MUST be confidential when it is associated with a telephone entity or supports a report against one, as specified in § 6.2.1 Automated Records. A client SHOULD submit evidence associated with a telephone entity as confidential, and a host MAY mark such evidence confidential whatever the client requested.
The number that a call or message presents as its origin can be forged, so that the number of an uninvolved subscriber appears as the source of abuse. That number is an assertion of the originator, which a client relays without being able to verify it. A host SHOULD take this into account before it decreases the reputation of a telephone entity or blacklists it on the basis of the number presented, for example by preferring temporary blacklist records, as described in § 7.1 Client Assertions.
8.4. Identifier Hash
The SHA-256 identifier is the SHA-256 digest [FIPS-180-4] [RFC6234] of the UTF-8 [RFC3629] bytes of the canonical entity address, serialized as a 64-character lowercase hexadecimal string. It is a deterministic cryptographic identifier, not an anonymity or confidentiality mechanism.
8.5. Use of Identifiers
Record references—evidence, reports, blacklist records, operators, file attachments, and audit log entries—are addressed by their UUID. Entities are addressed by any entity identifier form.
9. Protocol Fundamentals
This part of the specification defines how the OFD interface is carried over HTTP: the transport, the path structure, the data formats, and the request and response model. It is the foundation on which the methods of the interface are defined.
9.1. HTTP and Transport
The OFD interface is carried over HTTP [RFC9110]. The term HTTP includes HTTP over TLS (HTTPS) as defined in [RFC9110]; a host MAY serve its interface over HTTPS and SHOULD do so when authentication or confidential data is involved. A host MUST support HTTP/1.1 [RFC9112], and MAY support any newer version of HTTP.
Every path defined in this specification is relative to the base URL of
the host: a request to a host whose base URL is https://db.example.org and
whose resource path is /entities is made to the URL
https://db.example.org/entities.
As specified in § 5 Architecture, the protocol is stateless. Each request is self-contained: it identifies the operation to perform, carries its own parameters, and, when authentication is required, presents its own access token.
Responses are transmitted with the media type application/json; charset=utf-8
unless a method specifies otherwise, as for file downloads. Requests carry their
parameters in the query string, in a JSON or form-encoded body, or, for file
uploads, in a multipart/form-data body, as specified in § 9.4 Requests.
9.2. Path Structure
The resources of a host are laid out under a small set of path domains, each serving one collection of the federated database or one derived view. The domains and their root paths are:
| Domain | Root path | Content |
|---|---|---|
| Information | /info
| Description of the host and the state of its federated database. |
| Search | /search
| Search across the database. |
| Scan | /scan
| Analysis of submitted content, returning a classification, suggested action, and risk assessment. |
| Audit | /audit
| The audit log of the database. |
| Entities | /entities
| The entity registry. |
| Operators | /operators
| Operator accounts. |
| Evidence | /evidence
| Evidence records. |
| Blacklist | /blacklist
| Blacklist records. |
| Reports | /reports
| Reports. |
| Attachments | /attachments
| File attachments. |
The root path / serves the audit log collection through the List Audit
Logs method. The other audit methods are served under /audit, such as
/audit/{uuid} and /audit/search.
9.2.1. Route Patterns
A route pattern is the path expression bound to a method: a literal path, or a path that contains dynamic segments. Two kinds of dynamic segments are defined:
-
UUID segments, matching a 36-character UUID, address records of the federated database;
-
entity identifier segments, matching an entity identifier, address records of the entity registry.
An entity identifier segment accepts every entity identifier form: the
UUID, the SHA-256 identifier, or the entity address. The entity address
may be a named entity address (local-part@entity-host) or a host
entity address (the entity host alone), and its entity host may be a DNS name,
an IPv4 address, or an IPv6 address. An entity address in a path segment MUST
be in canonical form, as specified in § 8.2 Entity Address Canonicalization; a
host MUST reject a path segment that is not a valid entity identifier with
HTTP 400. For example, GET /entities/example.com,
GET /entities/john@example.com, and GET /entities/2001:db8::1 each address
an entity by its entity address.
Literal paths take precedence over route patterns that contain dynamic
segments. For example, the path /entities/search is served by the search
method of the entities domain, never by a pattern that would match
/entities/{identifier}. A host MUST NOT match a dynamic segment to a string
that satisfies a literal sub-path of the same domain, whatever the request
method. An entity whose entity address equals such a literal sub-path, such as
a host entity named search or top-threats, is therefore addressed in a path
by its SHA-256 identifier or its UUID.
A host percent-decodes [RFC3986] each path segment exactly once before
matching it against a route pattern and validating it. A client MUST
percent-encode a % that occurs in an entity address, and any other
character that is not permitted unencoded in a path segment. A path segment
that contains a / after decoding is not a valid entity identifier or UUID,
and a host MUST reject it with HTTP 400 rather than match it as a separator.
An entity address carried in a query string or a form-encoded body is
decoded as specified for that format [URL], in which an unencoded + denotes
a space. A client MUST therefore percent-encode the +, %, &, =, and #
characters of an entity address, such as the + of john+tag@example.com,
when it carries the address in a query string or a form-encoded body.
A host determines the form of an entity identifier, whether it is carried in a path segment or in a request parameter, as follows: a value that is a UUID in the form defined in § 9.3 Data Formats is resolved as a UUID; otherwise, a value of 64 lowercase hexadecimal characters is resolved as a SHA-256 identifier; otherwise, the value is resolved as an entity address. A host entity whose address has the form of a UUID is therefore addressed by its SHA-256 identifier.
9.2.2. Route Conventions
The methods of the interface follow a uniform route convention.
Collection routes address a collection of records, for example
GET /entities and POST /reports. Item routes address a single
record, for example GET /entities/{identifier} and
DELETE /evidence/{uuid}. Sub-resource routes address records related to a
parent record, for example GET /entities/{identifier}/evidence and
GET /operators/{uuid}/blacklist. Action routes address a state transition
of a record, for example PATCH /blacklist/{uuid}/lift and
PATCH /reports/{uuid}/close. Search routes query a collection, for
example GET /entities/search and GET /blacklist/search.
The HTTP request method conveys the intent of the request, as summarized in the following table:
| HTTP method | Semantics | Examples |
|---|---|---|
| GET | Query and read records and derived views. | GET /entities, GET /reports/{uuid}
|
| POST | Create a record. | POST /evidence, POST /operators
|
| PATCH | Update a record or transition its state. | PATCH /entities/{identifier}, PATCH /reports/{uuid}/close
|
| DELETE | Remove a record. | DELETE /evidence/{uuid}
|
| PUT | An alternative to POST for uploading a file to the attachments domain, where the host accepts it. | PUT /attachments
|
9.3. Data Formats
The OFD interface exchanges JSON documents [RFC8259]. Records and JSON
request bodies are objects whose member names are lowercase and use underscores
to separate words, such as text_content and file_name. Points in time are
transmitted as Unix timestamps: the number of seconds since the epoch, in UTC,
as a JSON integer. Record identifiers are transmitted as 36-character lowercase
strings in the canonical 8-4-4-4-12 hyphenated form of UUIDs [RFC9562], and
hosts generate UUIDs of version 7 so that records are ordered by their time
of creation. Booleans are transmitted as JSON true or false in JSON request
bodies, and as the strings true or false in query strings and form bodies.
Text is transmitted as JSON strings, and scalar quantities are transmitted as
JSON numbers. A member whose definition requires a whole-number quantity, such
as a size or timestamp, is transmitted as a JSON integer. Values drawn from a
fixed set, such as record types, relationship types, category values, ordering
values, and classification values, are transmitted as uppercase strings. A host
SHOULD accept such values case-insensitively when received from a client; the
canonical form returned in responses is uppercase. For example, a category value
of with_relationship is treated as equivalent to
WITH_RELATIONSHIP. A request that carries a value outside the
defined set is a client error (HTTP 400), except for the category,
by, and order parameters of list and search methods,
which are treated as specified in § 9.4.4 Pagination, Filtering, and Ordering. A member that
carries no value is transmitted either as JSON null or omitted from the object,
and a client MUST treat both representations as equivalent.
9.4. Requests
A request to the OFD interface identifies the operation by its path and HTTP request method, carries its parameters, and, where required, presents authentication. Parameters are name/value pairs; a value is a string, an integer, a boolean, or, for parameters that accept structured values, a JSON object.
9.4.1. Parameter Sources
Parameters are read from the query string of the request URI [RFC3986], from
a form-encoded request body for requests with the media type
application/x-www-form-urlencoded [URL], from a JSON request body for
requests with the media type application/json, or, for file uploads and for
the scanning of files, from the parts of a multipart/form-data body
[RFC7578] other than the files themselves. A host MUST accept a JSON request
body whether or not its media type carries a charset parameter, and MUST treat
it as UTF-8 [RFC8259]. A host resolves a parameter deterministically; where
the same parameter appears in several sources, a form-encoded or multipart body
takes precedence over the query string, and the query string takes precedence
over a JSON body. This order is retained from earlier versions of the interface;
a client SHOULD supply each parameter in only one source.
A request body that declares the media type application/json but is not
parseable as JSON is a client error (HTTP 400).
9.4.2. JSON Request Bodies
Parameters that accept structured values, such as entity metadata, are carried as members of a JSON object in the request body. For example, a request that registers an entity with metadata is:
POST /entities HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
{
"host": "example.com",
"id": "admin",
"metadata": {"service": "webmail"}
}
9.4.3. File Uploads
A file attachment is submitted in one of two ways:
-
A direct upload is a request with the media type
multipart/form-data[RFC7578]. The uploaded file is carried in a part namedfile. -
A URL upload carries, in a parameter named
url, an absolute HTTP or HTTPS URL [RFC3986] from which the host retrieves the file itself. The parameter MAY be read from any of the sources described in § 9.4.1 Parameter Sources.
A client MUST NOT submit the content of a file attachment through any other parameter, and MUST NOT combine both ways in a single request. The rules that apply to each are specified in § 10.10.4 Upload Attachment.
Files submitted to the Scan Content method for analysis are not file
attachments. They are carried in a multipart/form-data body as specified in
§ 10.2.1.1 Scanned files, or named by URL as specified in § 10.2.1.2 Scanned file URLs, and only
become file attachments when the host records them as evidence.
9.4.4. Pagination, Filtering, and Ordering
Methods that return a list of records are paginated. Unless a method specifies otherwise, they accept the following query parameters:
-
limit, the maximum number of records to return. A host enforces a maximum for each method. Whenlimitis omitted, a list method uses the host maximum, and a search method uses 10. A value less than 1 or greater than the host maximum is not an error: a list method uses its host maximum instead, and a search method clamps the value to the range from 1 through its host maximum. -
page, the page to return, starting at 1. A value less than 1 is treated as 1. A page beyond the last record yields an empty array. -
category, a filter drawn from the category values defined for the collection. -
by, the member to sort by, drawn from the ordering values defined for the collection. -
order, the sort direction,ASCorDESC.
A host MUST ignore a category, by, or
order value that it does not recognize, and apply its default:
no category filter, and its default ordering for the collection. A host SHOULD
order records deterministically, so that consecutive pages neither repeat nor
omit records while the collection is unchanged.
Search methods take a query parameter q. A host trims leading and
trailing whitespace from the query and rejects the request with a client error
(HTTP 400) when q is absent or empty, or when the trimmed query is
shorter than two characters. A search matches records whose searchable members
contain the query as a substring. The characters % and _ in the query are
matched literally.
For a request authenticated as an operator, a host MAY additionally match members beyond those listed for a search method, such as the metadata of an entity, the note of evidence, or the UUIDs of the operators and records that a record refers to. A host MUST NOT match a member that the requester is not permitted to read, and MUST NOT match additional members for an unauthenticated request, so that the results of an unauthenticated search depend only on the members listed for the method.
9.5. Responses
Every response of the OFD interface is a JSON document, transmitted with the
media type application/json; charset=utf-8, except the download of a file attachment, which transmits the file itself.
9.5.1. Success Responses
A success response carries the result of a completed method: a serialized record, an array of records, or a generated identifier. When a method produces no result data, the response is the success envelope, a JSON document of the form:
{"success": true}
Each method definition specifies its successful status code and response body. Methods that create an independently addressable record normally use HTTP 201 Created and include its UUID in the response body, unless their definition specifies otherwise: Push Entity, which is idempotent and returns HTTP 200 OK whether or not it created the entity, and Submit Report, which returns HTTP 200 OK with the created records. Methods that query or read normally use HTTP 200 OK and carry the result directly in the response body: a single record is a JSON object, and a list of records is a JSON array.
9.5.2. Error Responses
An error response is a JSON document with the members:
-
success, fixed to false;
-
code, the HTTP status code of the error;
-
message, a human-readable description of the error;
-
retry_after, present only when the response tells the client when to retry, as specified in § 9.9 Rate Limiting: the number of seconds the client waits before repeating the request. Introduced in version
2.2.
The message member is intended for people and is not meant to be
parsed. A host MAY prefix it with the reason phrase of the status code, as in
Unauthorized: Authentication required. A client MUST determine the class of
the error from the status code and the code member, not from the
message.
The error status codes used by the OFD interface are as follows. HTTP 400 means the request could not be processed: missing or invalid parameters, an undecodable JSON body, or a path that matches no method. HTTP 401 means authentication is required, or the presented access token is invalid. HTTP 403 means the authenticated operator is not authorized to perform the method: the operator is disabled or lacks the required permissions. HTTP 404 means a referenced record does not exist, or the method is not available on the host, such as a search method on a host with search disabled. HTTP 409 means the request conflicts with the current state of a record, such as a name that is already in use. HTTP 429 means the request exceeds a rate limit of the host, and HTTP 503 means the host is temporarily unable to handle the request, as specified in § 9.9 Rate Limiting. HTTP 500 means an internal error occurred; a host MUST NOT disclose internal details in an error response, and uncaught errors are reported with the generic message "Internal Server Error".
For example, an unauthenticated request to an operation that requires authentication is answered with:
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
{"success": false, "code": 401, "message": "Unauthorized: Authentication required"}
9.5.3. Response Headers
Responses are transmitted with the Content-Type application/json; charset=utf-8
header and with cross-origin resource sharing (CORS) headers [FETCH]. The
Access-Control-Allow-Origin header permits a cross-origin request from an
origin whose hostname equals the hostname of the configured base URL of
the host; when the Origin header of the request matches, the host echoes it
and responds with the Vary: Origin header, otherwise it responds with the
origin of its configured base URL, which is the base URL without its path. The
Access-Control-Allow-Methods header is set to POST, PUT, GET, DELETE, and
PATCH. The Access-Control-Allow-Headers header is set to Content-Type and
Authorization. The Access-Control-Expose-Headers header is set to Retry-After,
so that a web application can read the Retry-After header of the responses
specified in § 9.9 Rate Limiting.
A host MUST answer a CORS preflight request [FETCH], an OPTIONS request to the path of any method, with a successful status code, such as HTTP 204 No Content, and the headers above. A preflight request does not carry an access token; the host MUST NOT require authentication for it and does not process it as specified in § 9.8 Request Processing.
9.6. Authentication
Some methods are publicly accessible; others require authentication. Whether a method requires authentication is determined by the definition of the method together with host configuration. A host MUST authenticate an operator before executing a method that requires authentication, and MUST NOT execute such a method on behalf of an unauthenticated requester.
9.6.1. Access Tokens
An access token authenticates an operator. Requests present the access token in the Authorization header using the Bearer scheme [RFC6750]:
Authorization: Bearer <token>
An access token consists only of characters permitted by the b64token
syntax of [RFC6750], so that it can be carried in the Authorization header.
The validity of a presented access token is established as follows; a request to a publicly accessible method is not rejected because of its token, as described below. A token that is not exactly 32 characters in length is malformed and is rejected as a client error (HTTP 400). A well-formed token that does not correspond to any operator is rejected as an authentication error (HTTP 401). A token that corresponds to a disabled operator is rejected as a permission error (HTTP 403).
A request requires authentication when the method or domain it addresses is not publicly accessible. A request to a publicly accessible method does not require authentication, but MAY present an access token to receive information that is returned only to an authenticated operator, such as entity metadata, or only to an operator holding a permission group, such as confidential evidence. For such a request:
-
A valid access token authenticates its operator, and the request is processed as a request of that operator.
-
An access token that is not valid, because it is malformed, does not correspond to any operator, or corresponds to a disabled operator, is ignored in the same way as a parameter the method does not accept: the host MUST NOT reject the request because of it, and processes the request as an unauthenticated request.
-
Authenticating never reduces access. A host MUST NOT reject the request, or return less information than it returns to an unauthenticated request, because the authenticated operator does not hold a permission group.
When a request whose token is ignored asks for information that is returned only to an authenticated operator, such as confidential evidence, the host responds as the method specifies for an unauthenticated request.
9.6.2. Authenticated Operator
The authenticated operator of a request is the operator bound to the access token presented by the request. A request that presents no token, or whose token is ignored as specified in § 9.6.1 Access Tokens, has no authenticated operator; a method that requires authentication and receives such a request responds with an authentication error (HTTP 401).
Operators whose access token is unset and the system operator MUST NOT be authenticated.
9.6.3. Root Operator
A host MAY configure a root access token. When the root access token is presented, the host authenticates the root operator: the administrator of the federated database. The root operator:
-
is created automatically when it does not exist, so that the host can be administered before any operator has been provisioned;
-
cannot be disabled;
-
is authoritative over the configuration of the host.
A root access token has the same format as any other access token, since a token of another length is rejected as malformed before it is compared.
A host MUST NOT allow the root access token to be disclosed or revoked by any operator other than the root operator.
9.7. Authorization
Authorization is governed by the permission groups granted to an operator. This specification defines three permission groups: client permissions, management permissions, and operator permissions. A host grants each group independently, and an operator MAY hold several groups at once. The root operator is authorized to perform every operation regardless of the groups it holds.
9.7.1. Permission Groups
Client permissions authorize an operator to submit information to the federated database: registering and updating entities, setting and clearing entity relationships, submitting evidence and reports, uploading file attachments, and scanning content.
Management permissions authorize an operator to manage the records of the federated database. Management permissions inherit all client permissions. In addition, they authorize the deletion of records, the management of blacklist records and of the whitelist, the clearing of reputation, access to confidential evidence, the classification of evidence and its linking to reports, and the assignment and closure of reports.
Operator permissions authorize an operator to manage the operators of the host: creating, deleting, enabling, and disabling operator accounts, modifying their names and permission groups, generating access tokens, managing their configuration, and updating evidence tags. Operator permissions do not inherit client permissions or management permissions.
9.7.2. Public Accessibility
Some operations of the OFD interface are available to requests without an authenticated operator. Whether a domain of the federated database is publicly accessible is a matter of host configuration: a host MAY expose a domain to the public or MAY require authentication to access it.
Each of the following MAY be exposed to unauthenticated requests or require authentication, subject to the requirements of the relevant method. A host publishes its choice for each in the ServerInformation object, under the member given in parentheses:
-
the audit log (
public_audit_logs), together with the list of audit log entry types that unauthenticated requests may see (public_audit_logs_visibility); -
evidence and the file attachments of non-confidential evidence (
public_evidence); -
blacklist records (
public_blacklist); -
the entity registry (
public_entities); -
entity metadata (
public_entity_metadata); -
telephone entities (
public_telephone_entities), which are hidden from unauthenticated requests unless exposed, as specified in § 8.3 Telephone Entities; -
reports (
public_reports); -
content scanning (
public_scan_content); -
entity relationship queries (
public_query_entity); -
the cross-collection Search method (
public_search).
The dedicated search method of each domain, such as Search Entities, follows the
accessibility of its domain, and Search Operators is always public; the record
types for which such a method is enabled and public are published as
search_types and public_search_types. A downstream consumer can therefore determine from the ServerInformation object alone
what is available without authentication.
The Get Server Information method is always public. Operator records are public information: the List Operators, Get Operator, and Search Operators methods, and operator records in the results of the Search method, are available to unauthenticated requests, whatever the host configuration.
9.7.3. Permission Matrix
The following matrix lists the operations of the OFD interface and the authorization required to perform each. The columns denote the requester: "Public" is a request without an authenticated operator; "Client", "Manager", and "Operator manager" are requests authenticated as operators holding client permissions, management permissions, and operator permissions, respectively. A cell marked "Configurable" is public when the host exposes the domain, and requires an authenticated operator when the host does not. When the host exposes the domain, an authenticated operator is never refused access that an unauthenticated request would have, as specified in § 9.6.1 Access Tokens. A request that requires authentication and presents no access token MUST be rejected as an authentication error (HTTP 401), and a request by an operator that lacks the required permission MUST be rejected as a permission error (HTTP 403).
| Operation | Public | Client | Manager | Operator manager |
|---|---|---|---|---|
| Server information | Yes | Yes | Yes | Yes |
| Read the audit log | Configurable | Yes | Yes | Yes |
| Read evidence and attachment content | Configurable | Yes | Yes | Yes |
| Read the blacklist | Configurable | Yes | Yes | Yes |
| Read entities | Configurable | Yes | Yes | Yes |
| Query entity relationships | Configurable | Yes | Yes | Yes |
| Read reports | Configurable | Yes | Yes | Yes |
| Scan content | Configurable | Yes | Yes | Configurable |
| Search | Configurable | Yes | Yes | Yes |
| Read entity metadata | Configurable | Yes | Yes | Yes |
| Read operator accounts | Yes | Yes | Yes | Yes |
| Read one’s own operator account | No | Yes | Yes | Yes |
| Generate one’s own access token | No | Yes | Yes | Yes |
| Read and change one’s own configuration | No | Yes | Yes | Yes |
| List one’s own opened reports | No | Yes | Yes | Yes |
| Register or update entities | No | Yes | Yes | No |
| Submit evidence | No | Yes | Yes | No |
| Submit reports | No | Yes | Yes | No |
| Upload attachments | No | Yes | Yes | No |
| Manage entity relationships | No | Yes | Yes | No |
| Delete entities, evidence, or reports | No | No | Yes | No |
| Manage blacklist records | No | No | Yes | No |
| Set the whitelist, clear reputation | No | No | Yes | No |
| Manage evidence confidentiality | No | No | Yes | No |
| Classify evidence or link it to reports | No | No | Yes | No |
| Close or assign reports | No | No | Yes | No |
| List and delete attachments | No | No | Yes | No |
| Access confidential evidence | No | No | Yes | No |
| Manage operators | No | No | No | Yes |
| Manage operator permission groups and access tokens | No | No | No | Yes |
| Update evidence tags | No | No | No | Yes |
Note: The "Manage operators" row covers creating, deleting, enabling, disabling, and renaming operator accounts, and modifying their permission groups and configuration through the Update Operator Permissions and Update Operator Configuration methods. "Manage entity relationships" covers Set Entity Relationship and Clear Entity Relationship, and "Update evidence tags" covers Update Evidence Tag. "Read operator accounts" covers List Operators, Get Operator, and Search Operators, and "Read one’s own operator account" covers Get Self Operator. Reading a "Configurable" domain, reading one’s own operator account, generating one’s own access token, reading and changing one’s own configuration, and listing one’s own opened reports require only an authenticated operator, whatever permission groups it holds. The configuration of another operator is read and changed only with operator permissions. Scanning content that the host does not expose requires client permissions, so an operator without them can scan content only when content scanning is public.
9.7.4. Visibility Rules
The following rules restrict the information exposed by the operations above.
Entity metadata is returned to every request that has an authenticated operator. It is returned to unauthenticated requests, including requests whose
token is ignored as specified in § 9.6.1 Access Tokens, only when the host
publishes public_entity_metadata as true; otherwise the
metadata member of every EntityRecord returned to an
unauthenticated request is null. Telephone entities are further restricted,
as specified in § 8.3 Telephone Entities. An access token is disclosed
exactly once: in the response of the method that creates the operator or
generates the token. A host persists only a hash of the token, so the token
cannot be retrieved afterwards and the requester MUST retain it from that
response. It is not included in operator records returned by the host, including
the record of the authenticated operator.
The configuration of an operator is visible only to the operator itself and to
operators with operator permissions. A host MUST set the
configuration member of every OperatorRecord object to null when
the request is not authenticated, or is authenticated as another operator that
does not hold operator permissions, in every method that returns operator
records, including the Search method. The other members of an
operator record remain public, as specified in § 9.7.2 Public Accessibility.
A host MUST NOT return a confidential evidence record, or any of its members, to a requester without management permissions. A record returned to such a requester MAY contain the UUID of confidential evidence as an opaque reference. The reference MUST NOT grant access: an unauthenticated request for the confidential evidence is rejected with HTTP 401, and an authenticated operator without management permissions is rejected with HTTP 403.
A report is closed by an operator with management permissions who is also the operator to which the report is assigned, and reports that are already closed MUST NOT be closed again. When content scanning is not public, the authenticated operator MUST hold client permissions. The Search Attachments method requires management permissions.
9.8. Request Processing
All requests of the OFD interface, other than CORS preflight requests, which are answered as specified in § 9.5.3 Response Headers, are processed in a fixed order. The host first resolves the request to a method by matching the path and the HTTP request method against the route patterns of the interface, and responds with a client error (HTTP 400) if no route pattern matches. It then resolves the authenticated operator of the request as specified in § 9.6 Authentication, and applies its rate limits, responding with HTTP 429 to a request that exceeds them, as specified in § 9.9 Rate Limiting. Next it verifies that the authenticated operator has the permissions required by the method and that the requested domain is accessible to the requester, as specified in § 9.7 Authorization. It then resolves and validates the parameters of the request, including entity identifiers and references to records; invalid parameters are a client error (HTTP 400). After that it resolves the records referenced by the parameters, returning a not-found error (HTTP 404) for a reference to a record that does not exist, and a client error (HTTP 400) for a reference that is not well-formed. The host performs the operation of the method, and methods that modify persistent state record an entry in the audit log identifying the operator, the affected records, and the action performed. Finally, the host emits the success response, or an error response if any preceding step failed. A host MUST NOT emit a success response when any step failed, and MUST NOT disclose implementation details in an error response.
9.9. Rate Limiting
A host MAY limit the rate at which it accepts requests, to protect itself from the resource exhaustion described in § 12.7 Resource Exhaustion. Its limits are a matter of host policy: a host does not publish them in the ServerInformation object, and MAY change them at any time, for example according to its load. A client or downstream consumer MUST NOT assume that a host does not limit its requests.
A host MAY base its limits on any circumstance of a request, including:
-
its authentication state: a host counts the requests of an authenticated operator against that operator, and counts unauthenticated requests, including requests whose access token is ignored as specified in § 9.6.1 Access Tokens, against a property of the requester such as its network address;
-
the method it invokes;
-
the permission groups of the authenticated operator, or whether it is a bot operator;
-
the work it causes, such as the number of ContentInput objects of a Scan Content request and the files they carry or name.
A host SHOULD apply separate limits to the methods that clients and downstream consumers invoke as part of handling their own traffic, namely Scan Content and Query Entity, and SHOULD allow those methods a higher rate than the other methods of the interface, which are invoked far less often and which it MAY limit more strictly. A host SHOULD allow an authenticated request a rate at least as high as it allows an unauthenticated request to the same method, since authenticating never reduces access. A host MAY exempt the root operator from its limits.
A host MAY also apply a limit before it resolves the authenticated operator of a request, such as a limit on the requests of a network address or on the requests that present an access token that is not valid, which hinders the guessing of access tokens.
A request that exceeds a limit is rejected with an error response with HTTP 429 [RFC6585]. A host that is temporarily unable to handle a request for a reason that does not depend on the requester, such as overload or maintenance, MAY instead reject it with HTTP 503. In either case the host MUST NOT perform the operation of the method: the request does not modify persistent state, is not recorded in the audit log, and content it submits is not stored.
A host tells the client when to retry, rather than leaving it to guess, by
including in the error response both the Retry-After header [RFC9110], in
the delay-seconds form, and the retry_after member, each giving
the same number of seconds after which the request is expected to be accepted.
A host MUST include them in an error response with HTTP 429, SHOULD include
them in an error response with HTTP 503 when it can estimate when it will
accept the request again, and MUST NOT include the retry_after
member in any other error response. A host SHOULD give the shortest delay it
can determine.
When it receives such an error response, a client or downstream consumer:
-
MUST NOT repeat the request, or send another request it expects to be counted against the same limit, before the delay has elapsed;
-
MAY repeat the request once the delay has elapsed, including a request to a method that is not idempotent, since the rejected request was not performed;
-
SHOULD, when the response carries no delay, as from a host that implements an earlier minor version, wait before repeating the request and increase the wait exponentially with each consecutive rejection.
For example, a host that rejects a Scan Content request because its requester has exceeded the rate allowed for scanning responds with:
HTTP/1.1 429 Too Many Requests
Content-Type: application/json; charset=utf-8
Retry-After: 30
{"success": false, "code": 429, "message": "Too Many Requests: Rate limit exceeded", "retry_after": 30}
10. Interface Methods
A method is a discrete operation exposed by an OFD host, identified by a unique method name and bound to a route pattern paired with an HTTP request method, as specified in § 9.2 Path Structure. Methods are grouped by the domain of the resource they operate on: server information, scan and search, audit, entities, operators, evidence, blacklist, reports, and attachments.
The following subsections define the methods of the information surface and of the analysis surface (content scanning and search), followed by the methods of the data surface, grouped by domain.
10.1. Server Information
10.1.1. Get Server Information
Method name: getServerInformation
The Get Server Information method returns the telemetry of the host and the public-accessibility information that it publishes. This method is always public, as specified in § 9.7.2 Public Accessibility; a host MUST respond to it without requiring authentication.
The request is:
GET /info HTTP/1.1
A successful response is a success response with HTTP 200 OK and a body that is a JSON ServerInformation object. The members of a ServerInformation object are:
| Member | Type | Description |
|---|---|---|
name
| string | The name of the host. |
api_version
| string | The interface version implemented by the host, as specified in § 5.1 Versioning. A host implementing this version of the specification reports 2.2.
|
public_audit_logs
| boolean | Whether the audit log domain is publicly accessible. |
public_evidence
| boolean | Whether the evidence domain is publicly accessible. |
public_blacklist
| boolean | Whether the blacklist domain is publicly accessible. |
public_entities
| boolean | Whether the entity registry is publicly accessible. |
public_reports
| boolean | Whether the reports domain is publicly accessible. |
public_entity_metadata
| boolean | Whether entity metadata is included in entity records returned to unauthenticated requests. |
public_telephone_entities
| boolean | Whether telephone entities are exposed to unauthenticated requests like other entities, rather than hidden as specified in § 8.3 Telephone Entities. |
public_scan_content
| boolean | Whether the Scan Content method is publicly accessible. |
collects_public_scan_content
| boolean | Whether the host may store content submitted to the Scan Content method by unauthenticated requests, or records derived from it, as specified in § 13.4 Content Scanning. |
public_query_entity
| boolean | Whether the Query Entity method is publicly accessible. |
allow_illegal_content
| boolean | Whether the host accepts reports with the ILLEGAL_CONTENT incident type, as specified in § 10.9.2 Submit Report.
|
allow_url_uploads
| boolean | Whether the host accepts URL uploads through the Upload Attachment method, as specified in § 10.10.4 Upload Attachment. |
scan_content_types
| array of strings | The content types, as defined in § 10.7.2.1 Content type values, that the Scan Content method interprets according to their type. Always includes TEXT.
|
max_scan_files
| integer | The maximum number of files a single Scan Content request may carry, as specified in § 10.2.1.1 Scanned files; 0 when the host ignores the files of every request. Introduced in version 2.1.
|
max_scan_file_size
| integer | The maximum size, in bytes, of each file a Scan Content request may carry; 0 when the host ignores the files of every request. Introduced in version 2.1.
|
concerns
| array of strings | The concerns, as defined in § 10.2.2.2 Concern values, that the host can assess. |
default_concerns
| array of strings | The concerns the host assesses when a request does not name any, a subset of concerns.
|
search_enabled
| boolean | Whether search is enabled on the host. When false, every search method responds with HTTP 404. |
public_search
| boolean | Whether the cross-collection Search method is publicly accessible. |
search_types
| array of strings | The record types, as defined in § 10.3.1.1 Record type values, whose dedicated search method is enabled. Empty when search is disabled. |
public_search_types
| array of strings | The record types, as defined in § 10.3.1.1 Record type values, whose dedicated search method is enabled and publicly accessible. |
public_audit_logs_visibility
| array of strings | The audit log entry types that are publicly visible, when the audit log domain is public. |
audit_log_records
| integer | The number of audit log records held by the host. |
blacklist_records
| integer | The number of blacklist records held by the host. |
known_entities
| integer | The number of entity records held by the host. |
evidence_records
| integer | The number of evidence records held by the host. |
file_attachment_records
| integer | The number of file attachment records held by the host. |
operators
| integer | The number of operator accounts on the host. |
reports
| integer | The number of report records held by the host. |
10.2. Scan
10.2.1. Scan Content
Method name: scanContent
The Scan Content method submits one or more ContentInput objects to a host for analysis. The host extracts named entities from the text content, resolves them against the entity registry, and returns a classification, a risk score, a suggested action, and the detections that contributed to them, each with respect to the concerns of the request. Each ContentInput object is interpreted according to its content type, and MAY carry files, such as the images of a message, as specified in § 10.2.1.1 Scanned files, or name files for the host to retrieve by URL, as specified in § 10.2.1.2 Scanned file URLs. When the host is not configured to make scanning publicly accessible, the request MUST present a valid access token and the authenticated operator MUST hold client permissions.
The request is:
POST /scan HTTP/1.1 Authorization: Bearer <token> Content-Type: application/json; charset=utf-8
The request body MUST be a JSON object containing the members below, or, when
the request carries files, a multipart/form-data body as specified in
§ 10.2.1.1 Scanned files:
| Member | Type | Required | Description |
|---|---|---|---|
author
| string | No | An entity identifier for the author of the content. A telephone number is given as a telephone entity in canonical form, as specified in § 8.3 Telephone Entities. |
evidence
| ContentInput or array of ContentInput | Yes | One non-empty ContentInput object or a non-empty array of non-empty ContentInput objects to scan. |
top_k
| integer | No | An advisory maximum number of candidate classifications for a host to consider. Its effect on host analysis is not specified. |
threshold
| number | No | An advisory confidence threshold for host analysis. Its effect on host analysis is not specified. |
concerns
| array of strings | No | The concerns to assess, as specified in § 10.2.2.1 Concerns. Defaults to the default_concerns of the host.
|
In this method, a ContentInput object MAY also contain the
files member defined in § 10.2.1.1 Scanned files and the
file_urls member defined in § 10.2.1.2 Scanned file URLs.
A host MUST reject, with a client error (HTTP 400), a request whose
evidence member is absent, empty, not a non-empty ContentInput
object or array of non-empty ContentInput objects, or does not contain at
least one non-empty text_content member, at least one file, or at
least one file URL. A host MUST also reject, with a client error (HTTP 400), a
request containing a ContentInput object whose
content_type is not among the scan_content_types the
host publishes, and a request whose concerns member is invalid as
specified in § 10.2.2.1 Concerns.
For content of the HOSTNAME, URL, or
WEB_PAGE content type, a host MAY resolve the DNS name or
retrieve the URL itself, as specified in § 7.1 Client Assertions. A host that
does so MUST apply the restrictions on remote retrieval specified for URL
uploads in § 10.10.4 Upload Attachment, except that a name that cannot be resolved
or a URL that cannot be retrieved is not an error: the host continues its
analysis without the resource, and MAY treat the failure as an observation. A
host MAY decline to resolve or retrieve resources for unauthenticated requests,
and MAY reuse the results of an earlier resolution or retrieval.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the evidence input is invalid or contains neither text content, a file, nor a file URL, a content type is not supported for scanning,
concernsis invalid, the files are invalid as specified in § 10.2.1.1 Scanned files, the file URLs are invalid as specified in § 10.2.1.2 Scanned file URLs, orauthoris not a string or is an entity address with the entity hoste164.arpathat is not a canonical telephone entity. -
HTTP 401 if scanning is not public and the request is not authenticated.
-
HTTP 403 if scanning is not public and the authenticated operator does not hold client permissions.
-
HTTP 500 if the host fails to resolve the author entity.
10.2.1.1. Scanned files
A host accepts files with the content it scans, so that a client can submit,
for example, the images of a message together with its text. A host is not
required to scan the files it accepts: it MAY ignore the files of every request,
or of requests that are not authenticated or whose authenticated operator
does not hold client permissions. A host that ignores the files of a request
still validates the request as specified below, except against
max_scan_files and max_scan_file_size, and then treats
each file as one it does not interpret. A client therefore does not need to know
whether a host scans files before submitting them.
A request that carries files has the media type multipart/form-data
[RFC7578]. Each file is carried in a part of its own, whose name the client
chooses. Every other parameter of the method is carried in a part named after
it: the value of the evidence and concerns parameters
is the JSON text [RFC8259] that the member would hold in a JSON request
body, and the value of any other parameter is its text. For example, a request
that scans a text message carrying an image, and a second image sent on its own,
is:
POST /scan HTTP/1.1
Authorization: Bearer <token>
Content-Type: multipart/form-data; boundary=boundary
--boundary
Content-Disposition: form-data; name="author"
15550123456@e164.arpa
--boundary
Content-Disposition: form-data; name="evidence"
Content-Type: application/json
[
{"content_type": "SMS", "text_content": "Your parcel is on hold", "files": ["image_0"]},
{"files": ["image_1"]}
]
--boundary
Content-Disposition: form-data; name="image_0"; filename="parcel.jpg"
Content-Type: image/jpeg
...
--boundary
Content-Disposition: form-data; name="image_1"; filename="qr.png"
Content-Type: image/png
...
--boundary—
The files of a ContentInput object are named in its files
member:
| Member | Type | Required | Description |
|---|---|---|---|
files
| array of strings | No | The names of the parts that carry the files of the content, in order. When present, it MUST be a non-empty array. |
The name of a part that carries a file MUST consist of 1 through 64
characters, each an ASCII letter, an ASCII digit, _, or -, and MUST NOT be
the name of a parameter of the method. The files of a ContentInput object
are those carried in the parts its files member names, in order,
followed by those retrieved from the URLs of its file_urls member,
in order, as specified in § 10.2.1.2 Scanned file URLs. The file index of a
file is its zero-based position in that sequence, so that the file index of a
file carried in a part is its position in the files member. A
ContentInput object with files MAY omit text_content; its
content type still describes the content the files belong to, such as an
SMS for the images of an MMS message, and defaults to
TEXT.
A host MUST reject a request with a client error (HTTP 400) when:
-
a
filesmember is not a non-empty array of strings, or names a part that the request does not carry, that does not carry a file, or that anotherfilesmember, or the same one, already names; -
a part carries a file that no
filesmember names, carries more than one file, or has a name that is not permitted; -
the host scans the files of the request, and a file is empty or exceeds
max_scan_file_size, or the request carries more files thanmax_scan_files, counting the file URLs of the request that the host retrieves, as specified in § 10.2.1.2 Scanned file URLs.
The host determines the media type of each file from its content; it MUST NOT
trust the media type or the file name declared by the client. A host interprets
the files of the media types it supports, and does not announce which they are:
a client submits the files of the content regardless. A file of any other media
type, or one the host cannot interpret, is not an error: the host continues its
analysis without it, and the file does not affect the
classification, risk_score,
suggested_action, or detections of the result. A host
that interprets no file therefore returns the result it would return for the
rest of the content alone, and the risk_score of content that
consists only of such files remains at its starting value, as specified in
§ 10.2.2.4 Risk score.
A file is an assertion of the client, as specified in
§ 7.1 Client Assertions. A host MUST NOT retrieve resources that a file refers
to, such as the external resources of an image or a document, and an entity
that a host finds within a file, for example in a QR code, is resolved like any
other entity of the content, with a null entity_position.
Files submitted for scanning are not file attachments. A host uses them only
to produce the scan result and MUST discard them once it has done so, unless it
creates evidence from the content under the policy permitted by
§ 6.2 Population of the Database. A host that creates evidence from content that carried files
SHOULD record each file as a file attachment of that evidence, which is then
subject to the rules for evidence and file attachments, including those for
confidential and automated evidence in § 6.2.1 Automated Records. The file name it
records is the one supplied by the client, reduced to a safe form as described
in § 10.10.4 Upload Attachment. Files submitted without authenticating are subject
to collects_public_scan_content, as specified in
§ 13.4 Content Scanning.
10.2.1.2. Scanned file URLs
A client MAY name the files of a ContentInput object by URL instead of
carrying them in the request, for example when a message refers to its images
by address, such as the media of an MMS message held by the carrier, or when
the client does not hold the files itself. The host then retrieves each file and
treats it as a file of the content, as specified in § 10.2.1.1 Scanned files. A file URL
names a file of the content; it is not the content itself, which is submitted
with the URL content type. The file URLs of a ContentInput
object are named in its file_urls member:
| Member | Type | Required | Description |
|---|---|---|---|
file_urls
| array of strings | No | The absolute HTTP or HTTPS URLs [RFC3986] of the files of the content, in order. When present, it MUST be a non-empty array. Introduced in version 2.2.
|
A request whose ContentInput objects name files only by URL MAY be a JSON
request; a request that also carries files is a multipart/form-data body as
specified in § 10.2.1.1 Scanned files, in which the file_urls member is
part of the JSON text of the evidence part. For example:
POST /scan HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
{
"author": "15550123456@e164.arpa",
"evidence": {
"content_type": "SMS",
"text_content": "Your parcel is on hold",
"file_urls": ["https://mms.example.net/m/7f3a91/parcel.jpg"]
}
}
A client MUST NOT use the file_urls member with a host that reports
an interface version earlier than 2.2. A host that implements
version 2.2 accepts file URLs with the content it scans, but is not
required to retrieve them: it MAY ignore the file URLs of every request, of
requests that are not authenticated or whose authenticated operator does not
hold client permissions, and of requests whose files it ignores as specified
in § 10.2.1.1 Scanned files. A host does not announce whether it retrieves file URLs. A
host that ignores the file URLs of a request still validates them as specified
below, does not retrieve them, and treats each as a file it does not interpret.
A client therefore does not need to know whether a host retrieves file URLs
before naming them; a client that holds the files themselves SHOULD carry them
in the request instead.
A host MUST reject a request with a client error (HTTP 400) when a
file_urls member is not a non-empty array of strings, or contains a
string that is not an absolute URL with the scheme http or https, or that
contains user information. A host MAY enforce a maximum length for each URL.
A host that retrieves the file URLs of a request counts them towards
max_scan_files together with the files the request carries, and
retrieves each file as specified for URL uploads in § 10.10.4 Upload Attachment,
except that a file that cannot be retrieved is not an error. A file URL is
treated as a file the host cannot interpret when it is not permitted, such as
when its address is not publicly routable; when it cannot be resolved or
connected to, or its retrieval times out; when its final response does not have
a 2xx status code; or when its file is empty or exceeds
max_scan_file_size. The host continues its analysis without such a
file, and the result does not reveal why the file could not be retrieved. A host
MUST stop retrieving a file once its size exceeds
max_scan_file_size.
A file retrieved from a URL is subject to every rule of § 10.2.1.1 Scanned files that applies to a file carried in the request: the host determines its media type from its content, MUST NOT trust a media type declared by the server from which it was retrieved, MUST NOT retrieve resources that the file itself refers to, and discards it after the scan unless it records it as a file attachment of evidence created from the content. The file name it records is determined as for a URL upload in § 10.10.4 Upload Attachment. The URL itself is an assertion of the client, as specified in § 7.1 Client Assertions; the file is what the host observed at that URL.
10.2.2. ScannedContent object
A successful response to the Scan Content method is a success response with HTTP 200 OK and a body that is a JSON ScannedContent object. The members of a ScannedContent object are:
| Member | Type | Description |
|---|---|---|
author_entity
| ResolvedEntity or null | The resolved author entity, if an author identifier was provided and resolved. |
resolved_entities
| array of ResolvedEntity | The entities extracted from the content and resolved against the registry. |
classification
| ContentClassification or null | A host-derived classification of the submitted text content, if the host provides one. |
suggested_action
| string or null | A host recommendation, using one of the values defined in § 10.2.2.7 Suggested action values, or null. |
suggested_lift_timestamp
| integer or null | The Unix timestamp at which the host recommends lifting a temporary action, when applicable. |
scan_results
| object | Host-defined information about the factors contributing to the result. Clients MUST NOT rely on particular member names or values. |
risk_score
| number | The content risk score described in § 10.2.2.4 Risk score. |
detections
| array of Detection | The detections the host made with respect to the concerns of the request, as specified in § 10.2.2.3 Detection object. Empty when the host made none. |
The classification, risk_score,
suggested_action, suggested_lift_timestamp, and
detections members describe the submitted content only with
respect to the effective concerns of the request, as specified in
§ 10.2.2.1 Concerns.
10.2.2.1. Concerns
A concern is one of the incident type values defined in
§ 10.8.1.1 Incident type values; the values a host accepts as concerns are listed in
§ 10.2.2.2 Concern values. A host publishes the concerns it can assess in the
concerns member of its ServerInformation object, and the
concerns it assesses when a request names none in its
default_concerns member. The effective concerns of a
request are the values of its concerns parameter, or the
default_concerns of the host when the parameter is absent.
A host MUST reject, with a client error (HTTP 400), a concerns
parameter that names no concern, that is not of the type the method defines for
it, or that names a value which is not among the concerns the host
publishes.
A host MUST NOT let its assessment of a concern that is not an effective concern
of the request affect the classification, risk_score,
suggested_action, suggested_lift_timestamp, or
detections it returns. In particular, the blocking suggested
actions defined in § 10.2.2.7 Suggested action values consider only active blacklist records whose incident type is an effective concern. Concerns do not filter
records: the active_blacklists member of a ResolvedEntity
object contains every active blacklist record of the entity, so that a client
can inspect them.
A host SHOULD NOT include ADVERTISING or TRACKING in
its default_concerns, so that a client that does not ask for them,
such as a service concerned only with unsolicited messages, is not affected by
them.
10.2.2.2. Concern values
Every value defined in § 10.8.1.1 Incident type values can be a concern, including
OTHER, so that a blacklist record of any incident type can
determine a blocking suggested action. A host MAY assess any subset of them.
10.2.2.3. Detection object
A Detection object describes one finding of a host about submitted content with respect to one of the effective concerns of the request. Its members are:
| Member | Type | Description |
|---|---|---|
concern
| string | The concern the detection relates to, one of the effective concerns of the request. |
content_index
| integer | The zero-based position, in the evidence member of the request, of the ContentInput object the detection relates to; 0 when the request carried a single object.
|
file_index
| integer or null | The file index of the file, within that ContentInput object, that the detection relates to, as specified in § 10.2.1.1 Scanned files; null when the detection does not relate to a file. Introduced in version 2.1.
|
entity
| string or null | The UUID of the entity the detection relates to, when it relates to an entity resolved from the content. |
source
| string | A host-defined name of the mechanism that made the detection, such as the name of a filter list or a classifier. Clients MUST NOT rely on particular values. |
confidence
| number or null | A host-defined confidence of the detection, when the mechanism provides one. |
verified
| boolean | False when the detection relies on context or other assertions of the client that the host has not verified, as specified in § 7.1 Client Assertions; true when it relies only on the submitted content, the records of the host, and information the host determined itself. |
A client SHOULD weigh a detection whose verified member is false as
no stronger than the context it supplied.
10.2.2.4. Risk score
A host starts the risk_score at 50 before evaluating the submitted
content. Higher values indicate greater risk; lower values indicate lower risk.
The score reflects only the effective concerns of the request, as specified in
§ 10.2.2.1 Concerns.
A host MAY apply any internal factors while evaluating content. Such factors MAY
include temporary or permanent blacklist records, classifications, entity
reputation, whitelist state, entity relationships, or other observations. For
example, a normal classification or good reputation can lower the score, while
blacklist records can raise it. The choice of factors, their weights, and the
thresholds used for suggested actions are not part of the OFD interface. Clients
MUST NOT infer a particular scoring algorithm from risk_score or
scan_results.
10.2.2.5. ResolvedEntity object
A ResolvedEntity object represents an entity that was identified in the scanned content, together with its active blacklist records and its optional parent entity. Its members are:
| Member | Type | Description |
|---|---|---|
entity
| EntityRecord | The entity record. |
entity_position
| ResolvedEntityPosition or null | The position of the entity mention in the content. |
active_blacklists
| array of BlacklistRecord | The active blacklist records associated with the entity. |
parent_entity
| ResolvedEntity or null | The resolved parent entity, if a relationship is defined. |
A ResolvedEntityPosition object contains the members offset
(integer), length (integer), and type (string). The
value of type is one of domain, url,
email, ipv4, ipv6, or
telephone, depending on how the entity was extracted from the
content. As an exception to § 9.3 Data Formats, these values are lowercase.
A host MAY extract telephone numbers from content as telephone entities. A
number written in national format can be interpreted only with the region in
which it was received, so a host SHOULD extract a number only when it is written
in international format or the context of the content supplies a region, as the
SMS content type does. A host SHOULD NOT extract digit
sequences that are not presented as telephone numbers, such as one-time codes or
order numbers.
10.2.2.6. ContentClassification object
A ContentClassification object describes the classification assigned to the content by the host. Its members are:
| Member | Type | Description |
|---|---|---|
classification_flag
| string | The classification, one of NORMAL, SUSPICIOUS, or MALICIOUS.
|
confidence
| number | The confidence score of the classification. |
detected_language
| string or null | The detected language of the content, if available. |
10.2.2.7. Suggested action values
The value of the suggested_action member is one of the following
uppercase strings, or null when no action is suggested. In a ScannedContent
object, the values refer to the author entity; in an EntityQueryResult
object, they refer to the queried entity and its relationship group.
PERMANENTLY_BLOCK_ENTITY-
The entity has one or more active permanent blacklist records.
TEMPORARILY_BLOCK_ENTITY-
The entity has one or more active temporary blacklist records, and no active permanent blacklist record.
BLOCK_CONTENT-
The risk score is high enough to treat the content as malicious.
CAUTION-
The risk score warrants attention, but not an automatic block.
PERMANENTLY_BLOCK_ENTITY and TEMPORARILY_BLOCK_ENTITY
consider only the active blacklist records whose incident type is an effective
concern of the request, as specified in § 10.2.2.1 Concerns; an active blacklist
record of any other incident type does not cause either value to be suggested.
10.2.2.8. Scanning rule names
The scan_results member MAY contain a host-defined mapping of
scanning rule names to numerical contributions. Its member names, scoring model,
and meanings are not part of the OFD interface. Clients MUST NOT require a
particular rule, score, or scoring algorithm. The following discussion and rule
names are non-normative examples only:
| Rule name | Applies when |
|---|---|
AUTHOR_BLACKLISTED
| The author entity has one or more active blacklist records. |
AUTHOR_PERMANENTLY_BLACKLISTED
| The author entity has one or more active permanent blacklist records. |
AUTHOR_WHITELISTED
| The author entity is whitelisted. |
AUTHOR_GOOD_REPUTATION
| The author entity has a good reputation. |
AUTHOR_BAD_REPUTATION
| The author entity has a bad reputation. |
AUTHOR_PARENT_BLACKLISTED
| The parent of the author entity has one or more active blacklist records. |
AUTHOR_PARENT_PERMANENTLY_BLACKLISTED
| The parent of the author entity has one or more active permanent blacklist records. |
AUTHOR_PARENT_WHITELISTED
| The parent of the author entity is whitelisted. |
AUTHOR_PARENT_GOOD_REPUTATION
| The parent of the author entity has a good reputation. |
AUTHOR_PARENT_BAD_REPUTATION
| The parent of the author entity has a bad reputation. |
NAMED_ENTITY_BLACKLISTED
| A resolved named entity has one or more active blacklist records. |
NAMED_ENTITY_PERMANENTLY_BLACKLISTED
| A resolved named entity has one or more active permanent blacklist records. |
NAMED_ENTITY_WHITELISTED
| A resolved named entity is whitelisted. |
NAMED_ENTITY_GOOD_REPUTATION
| A resolved named entity has a good reputation. |
NAMED_ENTITY_BAD_REPUTATION
| A resolved named entity has a bad reputation. |
NAMED_ENTITY_PARENT_BLACKLISTED
| The parent of a resolved named entity has one or more active blacklist records. |
NAMED_ENTITY_PARENT_PERMANENTLY_BLACKLISTED
| The parent of a resolved named entity has one or more active permanent blacklist records. |
NAMED_ENTITY_PARENT_WHITELISTED
| The parent of a resolved named entity is whitelisted. |
NAMED_ENTITY_PARENT_GOOD_REPUTATION
| The parent of a resolved named entity has a good reputation. |
NAMED_ENTITY_PARENT_BAD_REPUTATION
| The parent of a resolved named entity has a bad reputation. |
CLASSIFICATION_NORMAL
| The content was classified as normal. |
CLASSIFICATION_SUSPICIOUS
| The content was classified as suspicious. |
CLASSIFICATION_MALICIOUS
| The content was classified as malicious. |
10.3. Search
10.3.1. Search
Method name: search
The Search method searches several collections of the federated database
at once for records that match a query string. Its public accessibility is
configured independently of the domains it searches and published as
public_search; when it is not public, the request MUST present a
valid access token.
A host includes a record type in the results only when the dedicated search method of that type is enabled, and only to a requester permitted to read that type: operator records to every requester, file attachment records only to an operator with management permissions, as for the Search Attachments method, and records of every other type according to the accessibility of their domain. The host MUST apply the visibility rules of § 9.7.4 Visibility Rules to the results: confidential evidence, and the attachments of confidential evidence, are included only for an operator with management permissions, and audit log entries returned to an unauthenticated request are limited to the publicly visible entry types. For each record type, a host matches the query against the members listed for the dedicated search method of that type, as specified in § 9.4.4 Pagination, Filtering, and Ordering.
The request is:
GET /search?q={query}&type={types}&limit={limit}&page={page} HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
q
| Yes | string | The search query. It MUST contain at least two non-whitespace characters after trimming. |
type
| No | string | A comma-separated list of record types to search. If omitted, all searchable types are included. |
limit
| No | integer | The maximum number of results to return per record type. Defaults to 10. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. Defaults to 1. |
A host MUST reject a request whose q parameter is absent, empty,
or shorter than two non-whitespace characters with a client error (HTTP 400). A
host MUST reject a request whose type parameter contains a value
that is not one of the record type values defined in § 10.3.1.1 Record type values
with a client error (HTTP 400).
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of SearchResult objects, grouped by record type. A SearchResult object has the members:
| Member | Type | Description |
|---|---|---|
type
| string | The record type, one of the values defined in § 10.3.1.1 Record type values. |
record
| object | The matching record, serialized in the form defined for its record type. |
10.3.1.1. Record type values
The value of the type member, and of each value in the
type query parameter, is one of the following uppercase strings:
ENTITY-
An entity record from the entity registry.
EVIDENCE-
An evidence record.
BLACKLISTREPORT-
A report.
ATTACHMENTAUDIT_LOG-
An audit log entry.
OPERATOR-
An operator record.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the
qparameter is absent, empty, or shorter than two non-whitespace characters, or thetypeparameter contains a value that is not a record type. -
HTTP 401 if search is not public and the request is not authenticated.
-
HTTP 404 if search is disabled on the host.
-
HTTP 500 if the host fails to perform the search.
10.4. Audit
The audit methods expose the audit log of the federated database. They are read-only; every method that modifies the database records an entry in the audit log as specified in § 9.8 Request Processing.
10.4.1. AuditLog object
An AuditLog object is a single entry in the audit log. Its members are:
| Member | Type | Description |
|---|---|---|
uuid
| string | The UUID of the audit log entry. |
operator
| string or null | The UUID of the operator that performed the action, when applicable. |
entity
| string or null | The UUID of the entity affected by the action, when applicable. |
blacklist
| string or null | The UUID of the affected blacklist record, when applicable. |
evidence
| string or null | The UUID of the affected evidence record, when applicable. |
file_attachment
| string or null | The UUID of the affected file attachment, when applicable. |
report
| string or null | The UUID of the affected report, when applicable. |
type
| string | The type of the entry, one of the values defined in § 10.4.1.1 Audit log type values. |
message
| string | A human-readable description of the action. |
timestamp
| integer | The Unix timestamp at which the entry was created. |
10.4.1.1. Audit log type values
The value of the type member is one of the following uppercase
strings:
| Type | Category |
|---|---|
OPERATOR_CREATED
| Operator events |
OPERATOR_DELETED
| Operator events |
OPERATOR_DISABLED
| Operator events |
OPERATOR_ENABLED
| Operator events |
OPERATOR_UPDATED
| Operator events |
ATTACHMENT_UPLOADED
| Attachment events |
ATTACHMENT_DELETED
| Attachment events |
EVIDENCE_SUBMITTED
| Evidence events |
EVIDENCE_UPDATED
| Evidence events |
EVIDENCE_DELETED
| Evidence events |
REPORT_GENERATED
| Report events |
REPORT_SUBMITTED
| Report events |
REPORT_OPERATOR_ASSIGNED
| Report events |
REPORT_CLOSED
| Report events |
REPORT_DELETED
| Report events |
ENTITY_DELETED
| Entity events |
ENTITY_BLACKLISTED
| Entity events |
ENTITY_PUSHED
| Entity events |
ENTITY_UPDATED
| Entity events |
BLACKLIST_DELETED
| Blacklist events |
BLACKLIST_LIFTED
| Blacklist events |
BLACKLIST_EXTENDED
| Blacklist events |
OTHER
| Other |
10.4.1.2. Audit log category values
The value of the category parameter for the audit methods is one of
the following uppercase strings, selecting all audit log types in the
corresponding category:
OPERATOR_EVENTS-
Operator-related entries.
ATTACHMENT_EVENTS-
File attachment entries.
EVIDENCE_EVENTS-
Evidence entries.
REPORT_EVENTS-
Report entries.
ENTITY_EVENTS-
Entity entries.
BLACKLIST_EVENTS-
Blacklist entries.
OTHER-
Entries that do not belong to another category.
10.4.1.3. Audit log ordering values
The value of the by parameter is one of the following uppercase
strings:
TYPE-
Order by the
typemember. TIMESTAMP-
Order by the
timestampmember.
The value of the order parameter is one of the following uppercase
strings:
ASC-
Ascending order.
DESC-
Descending order.
10.4.2. List Audit Logs
Method name: listAuditLogs
The List Audit Logs method returns a paginated list of the entries of the audit log. The method is public when the audit log domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET / HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
limit
| No | integer | The maximum number of entries to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter entries by category, one of the values defined in § 10.4.1.2 Audit log category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.4.1.3 Audit log ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.4.1.3 Audit log ordering values. |
When the request is not authenticated, a host MUST return only entries whose
type is listed in the public_audit_logs_visibility
member of its ServerInformation object.
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of AuditLog objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 401 if the audit log is not public and the request is not authenticated.
-
HTTP 500 if the host fails to retrieve the audit log.
10.4.3. View Audit Entry
Method name: viewAuditEntry
The View Audit Entry method returns a single audit log entry by its UUID.
The method is public when the audit log domain is configured as public;
otherwise the request MUST present a valid access token. A host MUST return
a public entry only if its type is listed in the
public_audit_logs_visibility member of its ServerInformation
object.
The request is:
GET /audit/{uuid} HTTP/1.1
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the audit log entry. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON AuditLog object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the audit log is not public and the request is not authenticated.
-
HTTP 404 if the entry does not exist, or if the entry is not public and the request is unauthenticated.
-
HTTP 500 if the host fails to retrieve the entry.
10.4.4. Search Audit Logs
Method name: searchAuditLogs
The Search Audit Logs method searches the audit log for entries whose UUID or message matches a query string. The method is available only when the host has search enabled and has audit log search enabled. The method is public when the audit log domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /audit/search?q={query}&limit={limit}&page={page}&category={category}&by={by}&order={order} HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
q
| Yes | string | The search query. It MUST contain at least two non-whitespace characters after trimming. |
limit
| No | integer | The maximum number of entries to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter entries by category, one of the values defined in § 10.4.1.2 Audit log category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.4.1.3 Audit log ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.4.1.3 Audit log ordering values. |
A host MUST reject a request whose q parameter is absent, empty,
or shorter than two non-whitespace characters with a client error (HTTP 400).
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of AuditLog objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the
qparameter is absent, empty, or shorter than two non-whitespace characters. -
HTTP 401 if the audit log is not public and the request is not authenticated.
-
HTTP 404 if search is disabled on the host or if audit log search is disabled.
-
HTTP 500 if the host fails to perform the search.
10.5. Operators
The operators methods manage the operator accounts of a host and expose sub-resources of an operator. Operator records are public information: the List Operators, Get Operator, and Search Operators methods do not require authentication. All operator management methods require an authenticated operator with operator permissions, except where noted.
10.5.1. OperatorRecord object
An OperatorRecord object represents an operator account. Its members are:
| Member | Type | Description |
|---|---|---|
uuid
| string | The UUID of the operator. |
name
| string | The display name of the operator. |
disabled
| boolean | Whether the operator account is disabled. |
permissions
| OperatorPermissions | The permission groups the operator holds. |
configuration
| OperatorConfiguration or null | The configuration of the operator, or null when the requester may not see it, as specified in § 9.7.4 Visibility Rules: only the operator itself and operators with operator permissions see it. |
created
| integer | The Unix timestamp at which the operator was created. |
updated
| integer | The Unix timestamp at which the operator was last updated. |
10.5.1.1. OperatorPermissions object
An OperatorPermissions object states which permission groups an operator holds. Its members are:
| Member | Type | Description |
|---|---|---|
client
| boolean | Whether the operator holds client permissions. |
management
| boolean | Whether the operator holds management permissions. |
operator
| boolean | Whether the operator holds operator permissions. |
Management permissions inherit client permissions. The
client member therefore states whether the operator holds client
permissions in effect: it is true whenever management is true. The
operator member is independent of the other two, since operator
permissions inherit neither.
10.5.1.2. OperatorConfiguration object
An OperatorConfiguration object holds the settings of an operator that are not permissions. Its members are:
| Member | Type | Description |
|---|---|---|
auto_assign_reports
| boolean | Whether the operator opts in to the automatic assignment of reports that are not automated. |
auto_assign_automated_reports
| boolean | Whether the operator opts in to the automatic assignment of automated reports, as specified in § 6.2.1 Automated Records. |
is_bot
| boolean | Whether the operator is a bot operator. The evidence and reports it submits are automated, and its evidence is created as confidential, as specified in § 6.2.1 Automated Records. |
An opt-in to automatic report assignment does not require the host to assign a report, as specified in § 10.9 Reports.
10.5.1.3. Operator category values
The value of the category parameter for the list and search methods
is one of the following uppercase strings:
DISABLED-
Operators whose account is disabled.
ENABLED-
Operators whose account is enabled.
10.5.1.4. Operator ordering values
The value of the by parameter is one of the following uppercase
strings:
NAME-
Order by the
namemember. CREATED-
Order by the
createdmember. UPDATED-
Order by the
updatedmember.
The value of the order parameter is one of the following uppercase
strings:
ASC-
Ascending order.
DESC-
Descending order.
10.5.2. CreatedOperator object
A CreatedOperator object represents a newly created operator account and the raw access token generated for it. Its members are:
| Member | Type | Description |
|---|---|---|
uuid
| string | The UUID of the newly created operator. |
access_token
| string | The raw access token of the newly created operator. A host MUST return the raw token only in this response; it MUST NOT store the token in plaintext and MUST persist only a hash of the token. |
10.5.3. List Operators
Method name: listOperators
The List Operators method returns a paginated list of all operator accounts. The method is public; a host MUST NOT require the request to be authenticated.
The request is:
GET /operators HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
limit
| No | integer | The maximum number of operators to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by category, one of the values defined in § 10.5.1.3 Operator category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.5.1.4 Operator ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.5.1.4 Operator ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of OperatorRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 500 if the host fails to retrieve the operators.
10.5.4. Search Operators
Method name: searchOperators
The Search Operators method searches operator accounts by UUID or name. The method is public; a host MUST NOT require the request to be authenticated. Search over operators is available only when the host has search enabled and has operator search enabled.
The request is:
GET /operators/search?q={query}&limit={limit}&page={page}&category={category}&by={by}&order={order} HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
q
| Yes | string | The search query. It MUST contain at least two non-whitespace characters after trimming. |
limit
| No | integer | The maximum number of operators to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by category, one of the values defined in § 10.5.1.3 Operator category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.5.1.4 Operator ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.5.1.4 Operator ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of OperatorRecord objects.
A host MUST reject a request whose q parameter is absent, empty, or
shorter than two non-whitespace characters with a client error (HTTP 400).
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the
qparameter is absent, empty, or shorter than two non-whitespace characters. -
HTTP 404 if search is disabled on the host or if operator search is disabled.
-
HTTP 500 if the host fails to perform the search.
10.5.5. Get Operator
Method name: getOperator
The Get Operator method returns a single operator account by UUID. The method is public; a host MUST NOT require the request to be authenticated.
The request is:
GET /operators/{uuid} HTTP/1.1
A successful response is a success response with HTTP 200 OK and a body that is a JSON OperatorRecord object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 404 if the operator does not exist.
-
HTTP 500 if the host fails to retrieve the operator.
10.5.6. Get Self Operator
Method name: getSelfOperator
The Get Self Operator method returns the operator account of the authenticated operator. The request MUST be authenticated.
The request is:
GET /operators/self HTTP/1.1 Authorization: Bearer <token>
A successful response is a success response with HTTP 200 OK and a body that is a JSON OperatorRecord object.
A host MUST respond with an error response for the following conditions:
-
HTTP 401 if the request is not authenticated.
10.5.7. Create Operator
Method name: createOperator
The Create Operator method creates a new operator account. The request MUST
be authenticated as an operator with operator permissions. The names
root and system are reserved and MUST NOT be used.
Whether two names that differ only in case are the same name for the purpose
of uniqueness is host-defined; a client SHOULD NOT rely on case alone to
distinguish operator names. The permission groups and the configuration of
a new operator are host-defined; a client can read them through the Get
Operator method, and change them with the Update Operator Permissions and Update
Operator Configuration methods.
The request is:
POST /operators HTTP/1.1 Authorization: Bearer <token> Content-Type: application/json; charset=utf-8
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
name
| string | Yes | The display name of the new operator. It MUST be unique, MUST NOT exceed 32 characters, and MUST NOT be root or system, compared case-insensitively.
|
A successful response is a success response with HTTP 201 Created and a body that is a JSON CreatedOperator object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the
namemember is missing, empty, longer than 32 characters, or reserved. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold operator permissions.
-
HTTP 409 if an operator with the given name already exists.
-
HTTP 500 if the host fails to create the operator.
10.5.8. Update Operator Name
Method name: updateOperatorName
The Update Operator Name method changes the display name of an operator. The request MUST be authenticated as an operator with operator permissions. The name of the root operator or system operator MUST NOT be changed.
The request is:
PATCH /operators/{uuid}/update-name HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
name
| string | Yes | The new display name. It MUST be unique, MUST NOT exceed 32 characters, and MUST NOT be root or system, compared case-insensitively.
|
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, or the name is missing, empty, longer than 32 characters, or reserved.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold operator permissions, or if the target is the root or system operator.
-
HTTP 404 if the target operator does not exist.
-
HTTP 409 if the new name is already in use.
-
HTTP 500 if the host fails to update the operator.
10.5.9. Enable Operator
Method name: enableOperator
The Enable Operator method enables a previously disabled operator account. The request MUST be authenticated as an operator with operator permissions. An operator MUST NOT enable itself, the root operator, or the system operator.
The request is:
PATCH /operators/{uuid}/enable HTTP/1.1
Authorization: Bearer <token>
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, the target is the authenticated operator itself, or the operator is already enabled.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold operator permissions, or if the target is the root or system operator.
-
HTTP 404 if the target operator does not exist.
-
HTTP 500 if the host fails to enable the operator.
10.5.10. Disable Operator
Method name: disableOperator
The Disable Operator method disables an operator account, preventing it from authenticating. The request MUST be authenticated as an operator with operator permissions. An operator MUST NOT disable itself, the root operator, or the system operator.
The request is:
PATCH /operators/{uuid}/disable HTTP/1.1
Authorization: Bearer <token>
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, the target is the authenticated operator itself, or the operator is already disabled.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold operator permissions, or if the target is the root or system operator.
-
HTTP 404 if the target operator does not exist.
-
HTTP 500 if the host fails to disable the operator.
10.5.11. Delete Operator
Method name: deleteOperator
The Delete Operator method permanently deletes an operator account. The request MUST be authenticated as an operator with operator permissions. The root operator and system operator MUST NOT be deleted. An operator SHOULD NOT delete itself, since doing so can leave the host without an operator able to manage operators; a host MAY reject such a request with a client error (HTTP 400).
A host that deletes the evidence, reports, or blacklist records created by an operator together with the operator, as permitted by § 6.1 Deletion of Records, MUST require the authenticated operator to also hold management permissions when the target operator has created any such record, since deleting them, and lifting the blocks they impose, is otherwise reserved to management permissions. Disabling an operator preserves its records.
The request is:
DELETE /operators/{uuid} HTTP/1.1
Authorization: Bearer <token>
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, or the target is the authenticated operator itself and the host rejects self-deletion.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold operator permissions, if the target is the root or system operator, or if the host would delete records created by the target operator and the authenticated operator does not hold management permissions.
-
HTTP 404 if the target operator does not exist.
-
HTTP 500 if the host fails to delete the operator.
10.5.12. Generate Access Token
Method name: generateAccessToken
The Generate Access Token method generates a new access token for the authenticated operator and invalidates its previous token. The request MUST be authenticated and requires no permission group. The root operator and system operator MUST NOT receive a new token through this method.
The request is:
POST /operators/refresh HTTP/1.1 Authorization: Bearer <token>
A successful response is a success response with HTTP 200 OK and a body that is the new access token string. This response is the only disclosure of the new token, as specified in § 9.7.4 Visibility Rules; a host MUST NOT store the token in plaintext and MUST persist only a hash of the token.
A host MUST respond with an error response for the following conditions:
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator is the root or system operator.
-
HTTP 500 if the host fails to generate the token.
10.5.13. Generate Operator Access Token
Method name: generateOperatorAccessToken
The Generate Operator Access Token method generates a new access token for
the operator identified by uuid. The request MUST be authenticated.
When uuid identifies an operator other than the authenticated operator, the authenticated operator MUST hold operator permissions; an
operator MAY always regenerate its own token through this method. The root operator and system operator MUST NOT receive a new token through this
method. Generating a new token invalidates the previous token of the target
operator.
The request is:
POST /operators/{uuid}/refresh HTTP/1.1
Authorization: Bearer <token>
A successful response is a success response with HTTP 200 OK and a body that is the new access token string. This response is the only disclosure of the new token, as specified in § 9.7.4 Visibility Rules; a host MUST NOT store the token in plaintext and MUST persist only a hash of the token.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the target is another operator and the authenticated operator does not hold operator permissions, or if the target is the root or system operator.
-
HTTP 404 if the target operator does not exist.
-
HTTP 500 if the host fails to generate the token.
10.5.14. Update Operator Permissions
Method name: updateOperatorPermissions
The Update Operator Permissions method grants or revokes permission groups of an operator. The request MUST be authenticated as an operator with operator permissions. The root operator and system operator MUST NOT be modified.
The request is:
PATCH /operators/{uuid}/permissions HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The request body MUST be a JSON object containing one or more members of an OperatorPermissions object, each a boolean:
| Member | Type | Required | Description |
|---|---|---|---|
client
| boolean | No | Whether the operator holds client permissions. |
management
| boolean | No | Whether the operator holds management permissions. |
operator
| boolean | No | Whether the operator holds operator permissions. |
A host MUST apply every supplied member and leave the permission groups that
are not supplied unchanged. Because management permissions inherit client permissions, a request MUST NOT leave an operator with management permissions
and without client permissions: a host MUST reject a request whose
client member is false while the operator would still hold
management permissions after the request, with a conflict error (HTTP 409), and
MUST NOT apply any of its members.
A successful response is a success response with HTTP 200 OK and a body that is the updated OperatorPermissions object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, the body contains no member, or a member is unknown or not a boolean.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold operator permissions, or if the target is the root or system operator.
-
HTTP 404 if the target operator does not exist.
-
HTTP 409 if the operator would hold management permissions without client permissions.
-
HTTP 500 if the host fails to update the permissions.
10.5.15. Update Operator Configuration
Method name: updateOperatorConfiguration
The Update Operator Configuration method changes the configuration of an operator. The request MUST be authenticated either as the operator whose configuration is changed, or as an operator with operator permissions. The root operator and system operator MUST NOT be modified.
The request is:
PATCH /operators/{uuid}/configuration HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The request body MUST be a JSON object containing one or more members of an OperatorConfiguration object:
| Member | Type | Required | Description |
|---|---|---|---|
auto_assign_reports
| boolean | No | Whether the operator opts in to the automatic assignment of reports that are not automated. |
auto_assign_automated_reports
| boolean | No | Whether the operator opts in to the automatic assignment of automated reports. |
is_bot
| boolean | No | Whether the operator is a bot operator. |
A host MUST apply every supplied member and leave the settings that are not
supplied unchanged. A change of is_bot applies to the evidence and
reports the operator submits afterwards, as specified in § 6.2.1 Automated Records.
A successful response is a success response with HTTP 200 OK and a body that is the updated OperatorConfiguration object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, the body contains no member, or a member is unknown or not a boolean.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator is not the target operator and does not hold operator permissions, or if the target is the root or system operator.
-
HTTP 404 if the target operator does not exist.
-
HTTP 500 if the host fails to update the configuration.
10.5.16. List Operator Audit Logs
Method name: listOperatorAuditLogs
The List Operator Audit Logs method returns the audit log entries associated with a specific operator. The method is public when the audit log domain is configured as public; otherwise the request MUST present a valid access token. An authenticated operator receives every entry of its own audit log, and an authenticated operator with operator permissions every entry of any operator. When the audit log domain is public, any other requester receives only the publicly visible entry types. When it is not public, an authenticated operator without operator permissions MAY view only its own audit log entries.
The request is:
GET /operators/{uuid}/audit HTTP/1.1
The parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
uuid
| Yes | string | The UUID of the operator, in the path. |
limit
| No | integer | The maximum number of entries to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by audit log category, one of the values defined in § 10.4.1.2 Audit log category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.4.1.3 Audit log ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.4.1.3 Audit log ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of AuditLog objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the audit log is not public and the request is not authenticated.
-
HTTP 403 if the audit log is not public and an authenticated operator without operator permissions attempts to view another operator’s audit log entries.
-
HTTP 404 if the target operator does not exist.
-
HTTP 500 if the host fails to retrieve the audit log.
10.5.17. List Operator Reports
Method name: listOperatorReports
The List Operator Reports method returns the reports submitted by a specific operator. The method is public when the reports domain is configured as public; otherwise the request MUST be authenticated.
The request is:
GET /operators/{uuid}/reports HTTP/1.1
The parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
uuid
| Yes | string | The UUID of the operator, in the path. |
limit
| No | integer | The maximum number of reports to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by report category, one of the values defined in § 10.9.1.1 Report category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.9.1.2 Report ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.9.1.2 Report ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of ReportRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if reports are not public and the request is not authenticated.
-
HTTP 404 if the target operator does not exist.
-
HTTP 500 if the host fails to retrieve the reports.
10.5.18. List Assigned Operator Reports
Method name: listAssignedOperatorReports
The List Assigned Operator Reports method returns the reports assigned to a specific operator. The method is public when the reports domain is configured as public; otherwise the request MUST be authenticated.
The request is:
GET /operators/{uuid}/reports/assigned HTTP/1.1
The parameters are the same as those defined in § 10.5.17 List Operator Reports.
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of ReportRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if reports are not public and the request is not authenticated.
-
HTTP 404 if the target operator does not exist.
-
HTTP 500 if the host fails to retrieve the reports.
10.5.19. List Operator Blacklist
Method name: listOperatorBlacklist
The List Operator Blacklist method returns the blacklist records created by a specific operator. The method is public when the blacklist domain is configured as public; otherwise the request MUST be authenticated.
The request is:
GET /operators/{uuid}/blacklist HTTP/1.1
The parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
uuid
| Yes | string | The UUID of the operator, in the path. |
limit
| No | integer | The maximum number of blacklist records to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
include_lifted
| No | boolean | Whether to include lifted blacklist records. Defaults to false. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of BlacklistRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the blacklist is not public and the request is not authenticated.
-
HTTP 404 if the target operator does not exist.
-
HTTP 500 if the host fails to retrieve the blacklist records.
10.5.20. List Operator Evidence
Method name: listOperatorEvidence
The List Operator Evidence method returns the evidence records submitted by
a specific operator. The method is public when the evidence domain is configured
as public; otherwise the request MUST be authenticated. When
include_confidential is true, the request MUST be authenticated as
an operator with management permissions.
The request is:
GET /operators/{uuid}/evidence HTTP/1.1
The parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
uuid
| Yes | string | The UUID of the operator, in the path. |
limit
| No | integer | The maximum number of evidence records to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
include_confidential
| No | boolean | Whether to include confidential evidence records. Defaults to false. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of EvidenceRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if evidence is not public and the request is not authenticated, or if
include_confidentialis true and the request is not authenticated. -
HTTP 403 if
include_confidentialis true and the authenticated operator does not hold management permissions. -
HTTP 404 if the target operator does not exist.
-
HTTP 500 if the host fails to retrieve the evidence.
10.6. Entities
The entities methods operate on the entity registry of the federated database: the records of the entities a host has encountered, their metadata, their reputation, their whitelist status, and their relationships to other entities.
10.6.1. Entity Metadata
The metadata member of an entity record is a single-dimension
associative structure represented as a flat JSON object. It allows operators to
define properties associated with the entity. For example, an entity with the
address 127.0.0.1 MAY contain metadata about the geolocation of the
host, and an entity with the address john@example.com MAY contain
metadata about the user, such as a preferred language, a registration
timestamp, or service-side attributes. A conforming client or service can choose
what metadata is relevant to include.
The Push Entity method, as specified in § 10.6.9 Push Entity, merges the supplied metadata into the entity record: it adds any key that is not already present, updates any key whose value has changed, and MUST NOT remove keys that are absent from the request. The Update Entity method, as specified in § 10.6.10 Update Entity, replaces the existing metadata with the supplied metadata rather than merging it.
A metadata value MUST be one of the following scalar types: JSON integer, JSON number, JSON string, JSON boolean, or JSON null. A metadata object MUST NOT contain nested objects or arrays.
A metadata key MUST be a non-empty JSON string whose length, measured in bytes of its UTF-8 encoding, is not greater than 64. A metadata string value MUST be non-empty, and its length, measured in bytes of its UTF-8 encoding, MUST NOT be greater than 1000. A key whose value is absent is expressed as JSON null, not as an empty string.
The final size of a metadata object is the length, in bytes, of the object after
encoding it as UTF-8 JSON with no insignificant whitespace and without escaping
non-ASCII characters or the solidus (/). The final size of an entity metadata
object MUST NOT exceed 8000 bytes.
A host MUST reject a request whose metadata member violates any of
the constraints in this section with a client error (HTTP 400).
10.6.2. Reputation
Reputation is a host-relative, longitudinal assessment of an entity. It reflects the issuing host’s accumulated evaluation over the period in which the host has observed or otherwise evaluated the entity; it is not limited to the entity’s most recent activity. Equal reputation values from different hosts MUST NOT be assumed to represent equivalent assessments.
The reputation member is an integer in the inclusive range −1000
through 1000. A new entity starts at 0. A host MUST NOT expose an operation that
assigns an arbitrary reputation value. Reputation adjustments MUST result from
host-defined events, observations, or automated policy.
A host SHOULD apply a decrease immediately when it observes behavior that warrants one, and SHOULD apply increases gradually for sustained normal behavior. For an incremental positive adjustment, a host SHOULD add from 1 through 10 points and SHOULD NOT add more than 10 points in one increment.
When a host creates a blacklist record, whether through the Blacklist Entity method or when closing a report, it MAY decrease the reputation of the blacklisted entity. It MAY also decrease the reputation of the entities directly related to the blacklisted entity through an entity relationship: the entity the blacklisted entity references as its relationship target, and the entities that reference the blacklisted entity as theirs. A host that does so SHOULD adjust each related entity at most once per blacklist record. The size of each adjustment is host policy.
The Clear Entity Reputation method is the only manual reputation operation. It resets reputation to 0; it MUST NOT accept a replacement value. Evidence, reports, blacklist records, and timestamps can help a consumer evaluate a host’s reputation assessment. Their absence does not invalidate the score, but means the consumer cannot independently determine its basis. A client or downstream consumer MUST NOT treat a reputation score as a required decision threshold.
10.6.3. EntityRecord object
An EntityRecord object represents a single entity in the entity registry. Its members are:
| Member | Type | Description |
|---|---|---|
uuid
| string | The UUID of the entity. |
hash
| string | The SHA-256 identifier of the entity, as defined in § 8.4 Identifier Hash. |
host
| string | The entity host of the entity. |
id
| string or null | The local part of the entity, when the entity is named. |
metadata
| object or null | The metadata of the entity, as specified in § 10.6.1 Entity Metadata. It is null when the entity has no metadata or when the requester is not permitted to read entity metadata, as specified in § 9.7.4 Visibility Rules. |
whitelisted
| boolean | Whether the entity is whitelisted. |
reputation
| integer | The reputation score of the entity. |
reputation_last_updated
| integer or null | The Unix timestamp at which the reputation score was last updated. |
relationship_entity
| string or null | The UUID of the related entity, when a relationship is defined. |
relationship_type
| string or null | The type of the relationship, one of the values defined in § 10.6.3.3 Entity relationship values. |
created
| integer | The Unix timestamp at which the entity was created. |
updated
| integer or null | The Unix timestamp at which the entity was last updated. |
A host MUST set the metadata member of an EntityRecord object
to null when the requester is not permitted to read entity metadata, as
specified in § 9.7.4 Visibility Rules. A consumer therefore cannot distinguish
redacted metadata from absent metadata, and MUST NOT infer that an entity has no
metadata from a null value.
10.6.3.1. Entity category values
The value of the category parameter for the list and search methods
is one of the following uppercase strings:
WHITELISTED-
Entities that are whitelisted.
NOT_WHITELISTED-
Entities that are not whitelisted.
WITH_RELATIONSHIP-
Entities that have a relationship to another entity.
WITHOUT_RELATIONSHIP-
Entities that do not have a relationship to another entity.
10.6.3.2. Entity ordering values
The value of the by parameter is one of the following uppercase
strings:
HOST-
Order by the
hostmember. ID-
Order by the
idmember. REPUTATION-
Order by the
reputationmember. CREATED-
Order by the
createdmember. UPDATED-
Order by the
updatedmember.
The value of the order parameter is one of the following uppercase
strings:
ASC-
Ascending order.
DESC-
Descending order.
10.6.3.3. Entity relationship values
An entity relationship is a pointer stored on an entity record that
declares how that entity relates to another entity in the entity registry.
The relationship_entity member of the EntityRecord object carries
the UUID of the related entity, and the relationship_type member
carries the type of the connection. Any number of entities MAY point at the same
related entity, each declaring its own relationship type.
For example, the person using the entity john@example.com manages a
bot, uses an alias account, and relays traffic through a proxy. The entity
records of these identifiers declare their relationship to
john@example.com as follows:
bot@computers.com -> john@example.com [CHILD] alice@example.com -> john@example.com [ALTERNATIVE] john@proxy.com -> john@example.com [PROXY]
An entity relationship is an assertion made by the host that two entities are related in the stated way. It is not a mathematical fact or proof of a shared real-world actor. A downstream consumer MAY consider the assertion when applying its own policy and SHOULD evaluate the records supporting it where available.
The value of the relationship_type member, and of the
relationship_type parameter of the Set Entity Relationship method,
is one of the following uppercase strings:
ALTERNATIVE-
The entity is an alternative account of the related entity; for example, an alias that the same actor uses at another service.
PROXY-
The entity acts as a proxy for the related entity; for example, a service that relays traffic for the related entity.
CHILD-
The entity is dependent on the related entity; for example, a bot that belongs to the related entity and operates under its control.
10.6.4. List Entities
Method name: listEntities
The List Entities method returns a paginated list of entity records from the entity registry. The method is public when the entity registry is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /entities HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
limit
| No | integer | The maximum number of entities to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by category, one of the values defined in § 10.6.3.1 Entity category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.6.3.2 Entity ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.6.3.2 Entity ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of EntityRecord objects, with metadata redacted as specified in § 10.6.3 EntityRecord object.
A host MUST respond with an error response for the following conditions:
-
HTTP 401 if the entity registry is not public and the request is not authenticated.
-
HTTP 500 if the host fails to retrieve the entities.
10.6.5. Search Entities
Method name: searchEntities
The Search Entities method searches the entity registry for records whose UUID, host, or local part matches a query string. The method is available only when the host has search enabled and has entity search enabled. The method is public when the entity registry is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /entities/search?q={query}&limit={limit}&page={page}&category={category}&by={by}&order={order} HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
q
| Yes | string | The search query. It MUST contain at least two non-whitespace characters after trimming. |
limit
| No | integer | The maximum number of results to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by category, one of the values defined in § 10.6.3.1 Entity category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.6.3.2 Entity ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.6.3.2 Entity ordering values. |
A host MUST reject a request whose q parameter is absent, empty,
or shorter than two non-whitespace characters with a client error (HTTP 400).
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of EntityRecord objects, with metadata redacted as specified in § 10.6.3 EntityRecord object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the
qparameter is absent, empty, or shorter than two non-whitespace characters. -
HTTP 401 if the entity registry is not public and the request is not authenticated.
-
HTTP 404 if search is disabled on the host or if entity search is disabled.
-
HTTP 500 if the host fails to perform the search.
10.6.6. Top Threats
Method name: getTopThreats
The Top Threats method returns the entity records with the lowest (most negative) reputation scores. The method is public when the entity registry is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /entities/top-threats HTTP/1.1
The query parameter is:
| Parameter | Required | Type | Description |
|---|---|---|---|
limit
| No | integer | The maximum number of entities to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of EntityRecord objects, with metadata redacted as specified in § 10.6.3 EntityRecord object.
A host MUST respond with an error response for the following conditions:
-
HTTP 401 if the entity registry is not public and the request is not authenticated.
-
HTTP 500 if the host fails to retrieve the entities.
10.6.7. Get Entity Record
Method name: getEntityRecord
The Get Entity Record method returns a single entity record by its entity identifier. The method is public when the entity registry is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /entities/{identifier} HTTP/1.1
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
identifier
| string | The entity identifier of the entity. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON EntityRecord object, with metadata redacted as specified in § 10.6.3 EntityRecord object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier.
-
HTTP 401 if the entity registry is not public and the request is not authenticated.
-
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to retrieve the entity.
10.6.8. Query Entity
Method name: queryEntity
The Query Entity method returns an entity, the other entities in its relationship group, and active blacklist records for the group. The relationship group of an entity comprises at least the entity, the entity it references through its entity relationship, if any, and the entities that reference it. A host MAY extend the group by following further relationships; a host that does so MUST include each entity at most once, so that a cycle of relationships, including a relationship of an entity to itself, terminates. A host MAY independently make this method public; otherwise the request MUST present a valid access token.
The request is:
GET /entities/{identifier}/query?concerns={concerns} HTTP/1.1
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
identifier
| string | The entity identifier of the queried entity. |
The query parameter is:
| Parameter | Required | Type | Description |
|---|---|---|---|
concerns
| No | string | A comma-separated list of concerns whose blacklist records determine the suggested action, subject to the rules of § 10.2.2.1 Concerns. Defaults to the default_concerns of the host.
|
A successful response is a success response with HTTP 200 OK and a body that is a JSON EntityQueryResult object:
| Member | Type | Description |
|---|---|---|
entity_record
| EntityRecord | The queried entity. |
related_entities
| array of EntityRecord | Other entities in the queried entity’s relationship group. |
active_blacklists
| array of BlacklistRecord | The active blacklist records associated with the queried entity and its relationship group. |
suggested_action
| string or null | A host recommendation based on the active blacklist records whose incident type is an effective concern of the request: PERMANENTLY_BLOCK_ENTITY, TEMPORARILY_BLOCK_ENTITY, or null.
|
suggested_lift_timestamp
| integer or null | The Unix timestamp at which the host recommends lifting a temporary action, when applicable. |
The active_blacklists member contains every active blacklist record
of the relationship group, whatever its incident type, except those a host
omits as specified in § 8.3 Telephone Entities.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier, or
concernsis invalid. -
HTTP 401 if entity relationship queries are not public and the request is not authenticated.
-
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to retrieve the relationship group.
10.6.9. Push Entity
Method name: pushEntity
The Push Entity method registers a new entity in the entity registry, or merges supplied metadata into an existing entity. The request MUST be authenticated as an operator with client permissions. A host MUST treat the registration of an entity that already exists, including concurrent registrations of the same entity, as idempotent: it returns the UUID of the existing entity after merging the supplied metadata.
The request is:
POST /entities HTTP/1.1 Authorization: Bearer <token> Content-Type: application/json; charset=utf-8
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
host
| string | Yes | The entity host of the entity. |
id
| string | No | The local part of the entity. |
metadata
| object | No | The metadata to associate with the entity. |
A host MUST reject a request whose host member is missing or not a
string with a client error (HTTP 400). A host MUST reject a request whose
metadata member is not a JSON object with a client error (HTTP 400).
A successful response is a success response with HTTP 200 OK and a body that is the UUID of the registered or updated entity.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the request body is missing the
hostmember, the entity host or local part is not in canonical form as specified in § 8.2 Entity Address Canonicalization, or the request contains invalid metadata. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold client permissions.
-
HTTP 500 if the host fails to register or update the entity.
10.6.10. Update Entity
Method name: updateEntity
The Update Entity method updates the metadata of an existing entity. The request MUST be authenticated as an operator with client permissions.
The request is:
PATCH /entities/{identifier} HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
identifier
| string | The entity identifier of the entity. |
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
metadata
| object | Yes | The metadata to replace the existing entity metadata. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier, or the request body is missing the
metadatamember, it is not a JSON object, or it violates the constraints of § 10.6.1 Entity Metadata. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold client permissions.
-
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to update the entity.
10.6.11. Delete Entity
Method name: deleteEntity
The Delete Entity method permanently deletes an entity record from the entity registry. The request MUST be authenticated as an operator with management permissions.
The request is:
DELETE /entities/{identifier} HTTP/1.1
Authorization: Bearer <token>
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
identifier
| string | The entity identifier of the entity. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to delete the entity.
10.6.12. Set Entity Relationship
Method name: setEntityRelationship
The Set Entity Relationship method sets a relationship between the entity
identified by the path and a related entity. The relationship is directional:
the source entity (the path identifier) points to the related entity
(target_identifier). Multiple sources MAY reference the same related entity.
An entity has at most one relationship; setting a relationship replaces any
existing relationship of the source entity. A host MAY reject a relationship of
an entity to itself with a client error (HTTP 400). The request MUST be
authenticated as an operator with client permissions.
The request is:
PATCH /entities/{identifier}/relationship HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
identifier
| string | The entity identifier of the source entity. |
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
target_identifier
| string | Yes | The entity identifier of the related entity. |
relationship_type
| string | Yes | The type of the relationship, one of the values defined in § 10.6.3.3 Entity relationship values. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier, the request body is missing a required member, the related entity identifier is malformed, or the relationship type is not defined in § 10.6.3.3 Entity relationship values.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold client permissions.
-
HTTP 404 if the source entity or the related entity does not exist.
-
HTTP 500 if the host fails to set the relationship.
10.6.13. Clear Entity Relationship
Method name: clearEntityRelationship
The Clear Entity Relationship method removes the relationship of the entity identified by the path. The request MUST be authenticated as an operator with client permissions.
The request is:
DELETE /entities/{identifier}/relationship HTTP/1.1
Authorization: Bearer <token>
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
identifier
| string | The entity identifier of the entity. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold client permissions.
-
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to clear the relationship.
10.6.14. Clear Entity Reputation
Method name: clearEntityReputation
The Clear Entity Reputation method resets the reputation score of an entity to zero. The request MUST be authenticated as an operator with management permissions.
The request is:
PATCH /entities/{identifier}/clear-reputation HTTP/1.1
Authorization: Bearer <token>
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
identifier
| string | The entity identifier of the entity. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to clear the reputation.
10.6.15. Set Entity Whitelist
Method name: setEntityWhitelist
The Set Entity Whitelist method sets or removes the whitelist status of an entity. The request MUST be authenticated as an operator with management permissions. While an entity is whitelisted, the host MUST NOT adjust its reputation, as specified in the definition of the whitelist.
The request is:
PATCH /entities/{identifier}/whitelist HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
identifier
| string | The entity identifier of the entity. |
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
whitelisted
| boolean | Yes | Whether the entity is whitelisted. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier, or the request body is missing the
whitelistedmember or it is not a boolean. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to update the whitelist state.
10.6.16. List Entity Audit Logs
Method name: listEntityAuditLogs
The List Entity Audit Logs method returns the audit log entries associated with a specific entity. The method is public when the audit log domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /entities/{identifier}/audit HTTP/1.1
The parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
identifier
| Yes | string | The entity identifier of the entity, in the path. |
limit
| No | integer | The maximum number of entries to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by audit log category, one of the values defined in § 10.4.1.2 Audit log category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.4.1.3 Audit log ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.4.1.3 Audit log ordering values. |
type is listed in the public_audit_logs_visibility
member of its ServerInformation object.
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of AuditLog objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier.
-
HTTP 401 if the audit log is not public and the request is not authenticated.
-
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to retrieve the audit log.
10.6.17. List Entity Blacklist Records
Method name: listEntityBlacklistRecords
The List Entity Blacklist Records method returns the blacklist records associated with a specific entity. The method is public when the blacklist domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /entities/{identifier}/blacklist HTTP/1.1
The parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
identifier
| Yes | string | The entity identifier of the entity, in the path. |
limit
| No | integer | The maximum number of blacklist records to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
include_lifted
| No | boolean | Whether to include lifted blacklist records. Defaults to false. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of BlacklistRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier.
-
HTTP 401 if the blacklist is not public and the request is not authenticated.
-
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to retrieve the blacklist records.
10.6.18. List Entity Evidence
Method name: listEntityEvidence
The List Entity Evidence method returns the evidence records associated with
a specific entity. The method is public when the evidence domain is configured as
public; otherwise the request MUST present a valid access token. When
include_confidential is true, the request MUST be authenticated as an
operator with management permissions.
The request is:
GET /entities/{identifier}/evidence HTTP/1.1
The parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
identifier
| Yes | string | The entity identifier of the entity, in the path. |
limit
| No | integer | The maximum number of evidence records to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
include_confidential
| No | boolean | Whether to include confidential evidence records. Defaults to false. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of EvidenceRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier.
-
HTTP 401 if evidence is not public and the request is not authenticated, or if
include_confidentialis true and the request is not authenticated. -
HTTP 403 if
include_confidentialis true and the authenticated operator does not hold management permissions. -
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to retrieve the evidence.
10.6.19. List Entity Reports
Method name: listEntityReports
The List Entity Reports method returns the reports submitted against a specific entity. The method is public when the reports domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /entities/{identifier}/reports HTTP/1.1
The parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
identifier
| Yes | string | The entity identifier of the entity, in the path. |
limit
| No | integer | The maximum number of reports to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by report category, one of the values defined in § 10.9.1.1 Report category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.9.1.2 Report ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.9.1.2 Report ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of ReportRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a valid entity identifier.
-
HTTP 401 if reports are not public and the request is not authenticated.
-
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to retrieve the reports.
10.7. Evidence
The evidence methods operate on the evidence records of the federated database. Evidence is submitted against an entity, and an evidence record MAY be linked to a report. A confidential evidence record MUST be returned only to an operator with management permissions. Other returned records MAY refer to confidential evidence by UUID, as specified in § 9.7.4 Visibility Rules.
10.7.1. Evidence Metadata
The metadata member of an evidence record is a single-dimension
associative structure represented as a flat JSON object. It allows operators to
define properties associated with the evidence. The constraints on metadata
keys, values, and final size are the same as those defined for entity metadata
in § 10.6.1 Entity Metadata.
Evidence metadata is supplied once, when the evidence is submitted using the Submit Evidence method, as specified in § 10.7.5 Submit Evidence. After submission, the metadata MUST NOT be updated or merged.
A host MUST reject a request whose metadata member violates any of
the constraints in § 10.6.1 Entity Metadata with a client error (HTTP 400).
10.7.2. ContentInput object
A ContentInput object carries the content and descriptive data for one evidence record. It has the following optional members:
| Member | Type | Required | Description |
|---|---|---|---|
text_content
| string | No | Text content. When present, it MUST be non-empty and MUST NOT exceed 16,777,215 bytes. Its form depends on the content type, as specified in § 10.7.2.1 Content type values. |
content_type
| string | No | The content type, one of the values defined in § 10.7.2.1 Content type values. Defaults to TEXT.
|
context
| object | No | Descriptive context for the content, subject to the constraints in § 10.7.2.2 Content context. |
note
| string | No | An operator note. When present, it MUST be non-empty and MUST NOT exceed 65,535 bytes. |
tag
| string | No | A tag categorizing the content, as defined in § 10.7.2.3 Evidence tags. |
confidential
| boolean | No | Whether the content is confidential. Defaults to false. |
metadata
| object | No | Additional metadata, subject to the constraints in § 10.7.1 Evidence Metadata. |
The object MUST NOT contain members other than those defined above, except where a method extends it with members of its own, as Submit Evidence and Scan Content do. A host MUST reject a ContentInput object that violates any of these constraints with a client error (HTTP 400).
10.7.2.1. Content type values
The value of the content_type member is one of the following
uppercase strings. A host MUST accept every value for storage as evidence;
the values that the Scan Content method interprets according to their type are
published in scan_content_types, as specified in § 10.2.1 Scan Content.
TEXT-
Free-form text, such as a chat message. This is the default.
EMAIL-
An email message.
text_contentis the body of the message. SMS-
A text message received over a telephone network, such as an SMS or MMS message.
text_contentis the body of the message. Its sender, when it has an E.164 number, is identified as a telephone entity in theauthormember of a Scan Content request. WEB_PAGE-
A web page.
text_contentis text extracted from the page by the client, and theurlkey of the context is required. HOSTNAME-
A DNS name [RFC1034] observed by the client, for example in a DNS lookup.
text_contentis the name, with an internationalized domain name represented by its A-labels [RFC5890]. A host MAY convert the name to lowercase and remove a single trailing dot before analysis, and MUST reject a value that is not a DNS name, including an IP address literal, with a client error (HTTP 400). URL-
A URL observed by the client.
text_contentis an absolute URL [RFC3986]; a host MUST reject a value that is not an absolute URL with a client error (HTTP 400).
10.7.2.2. Content context
The context member of a ContentInput object is a flat JSON
object describing the circumstances of the content as the client observed them.
It is subject to the constraints on keys, values, and final size defined for
entity metadata in § 10.6.1 Entity Metadata, every value MUST be a non-empty JSON
string, and it MUST NOT contain keys other than those defined below for its
content type. Context is an assertion of the client, which a host treats as
specified in § 7.1 Client Assertions. The keys defined for each content type are:
| Content type | Key | Description |
|---|---|---|
EMAIL
| subject
| The subject of the message. |
EMAIL
| sender
| The address in the From header field of the message.
|
EMAIL
| reply_to
| The address in the Reply-To header field of the message.
|
SMS
| region
| The region in which the message was received, as an ISO 3166-1 alpha-2 code such as US, used to interpret numbers written in national format.
|
SMS
| sender_id
| The sender as presented to the recipient when it is not an E.164 number, such as a short code or an alphanumeric sender ID. |
WEB_PAGE
| url
| Required. The absolute HTTP or HTTPS URL that the client requested. |
WEB_PAGE
| final_url
| The URL at which the page was served after redirects, when it differs from url.
|
WEB_PAGE
| title
| The title of the page. |
WEB_PAGE
| description
| The description the page declares about itself. |
WEB_PAGE
| language
| The language of the page, as a language tag [BCP47]. |
HOSTNAME
| query_type
| The DNS resource record type queried, by its mnemonic, such as A or AAAA.
|
No keys are defined for the TEXT and URL content types.
The addresses in the context of an EMAIL are not authenticated by
the client and can be forged by the sender of the message; a host MUST NOT
treat them as establishing the identity of the sender.
A host MUST reject a ContentInput object whose context violates any of the
constraints in this section, or whose content type is WEB_PAGE and
whose context lacks the url key, with a client error (HTTP 400).
10.7.2.3. Evidence tags
An evidence tag is a short label chosen by the submitting operator, such as
phishing_link or spam-wave-7. A tag MUST consist of 1 through 32 characters,
each an ASCII letter, an ASCII digit, _, or -. Tags are case-sensitive.
Spaces are not permitted; _ is conventionally used in their place.
10.7.3. EvidenceRecord object
An EvidenceRecord object represents a single evidence record. Its members are:
| Member | Type | Description |
|---|---|---|
uuid
| string | The UUID of the evidence record. |
entity
| string | The UUID of the entity the evidence is associated with. |
operator
| string | The UUID of the operator that submitted the evidence. |
confidential
| boolean | Whether the evidence record is confidential. |
automated
| boolean | Whether the evidence is automated: created by the host itself or submitted by a bot operator, as specified in § 6.2.1 Automated Records. Automated evidence is created as confidential. |
text_content
| string or null | The text content of the evidence. |
content_type
| string | The content type of the evidence, one of the values defined in § 10.7.2.1 Content type values. TEXT for evidence submitted without one.
|
context
| object or null | The context submitted with the evidence, as specified in § 10.7.2.2 Content context. |
tag
| string or null | An optional tag categorizing the evidence. |
report
| string or null | The UUID of the report the evidence is linked to, when applicable. |
metadata
| object or null | Additional metadata attached to the evidence, as specified in § 10.7.1 Evidence Metadata. |
classification_flag
| string or null | The classification flag assigned to the evidence, one of the values defined in § 10.7.3.3 Classification flag values. |
note
| string or null | An optional note attached to the evidence. |
created
| integer | The Unix timestamp at which the evidence was created. |
updated
| integer or null | The Unix timestamp at which the evidence was last updated. |
10.7.3.1. Evidence category values
The value of the category parameter for the list and search methods
is one of the following uppercase strings:
CONFIDENTIAL-
Evidence records that are confidential.
NOT_CONFIDENTIAL-
Evidence records that are not confidential.
CLASSIFIED-
Evidence records that have a classification flag.
UNCLASSIFIED-
Evidence records that do not have a classification flag.
AUTOMATED-
Evidence records that are automated.
NOT_AUTOMATED-
Evidence records that are not automated.
10.7.3.2. Evidence ordering values
The value of the by parameter is one of the following uppercase
strings:
TAG-
Order by the
tagmember. CLASSIFICATION_FLAG-
Order by the
classification_flagmember. CREATED-
Order by the
createdmember. UPDATED-
Order by the
updatedmember.
The value of the order parameter is one of the following uppercase
strings:
ASC-
Ascending order.
DESC-
Descending order.
10.7.3.3. Classification flag values
The value of a classification or classification_flag
member, and of the classification_flag parameter of the Close
Report method, is one of the following uppercase strings:
NORMAL-
The content is considered normal.
SUSPICIOUS-
The content is considered suspicious.
MALICIOUS-
The content is considered malicious.
10.7.4. List Evidence
Method name: listEvidence
The List Evidence method returns a paginated list of evidence records. The
method is public when the evidence domain is configured as public; otherwise the
request MUST present a valid access token. When
include_confidential is true, the request MUST be authenticated as
an operator with management permissions.
The request is:
GET /evidence HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
limit
| No | integer | The maximum number of evidence records to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
include_confidential
| No | boolean | Whether to include confidential evidence records. Defaults to false. |
category
| No | string | Filter by category, one of the values defined in § 10.7.3.1 Evidence category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.7.3.2 Evidence ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.7.3.2 Evidence ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of EvidenceRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 401 if evidence is not public and the request is not authenticated, or if
include_confidentialis true and the request is not authenticated. -
HTTP 403 if
include_confidentialis true and the authenticated operator does not hold management permissions. -
HTTP 500 if the host fails to retrieve the evidence.
10.7.5. Submit Evidence
Method name: submitEvidence
The Submit Evidence method creates a new evidence record for a known entity. The request MUST be authenticated as an operator with client permissions. Evidence submitted by a bot operator is automated and is created as confidential, as specified in § 6.2.1 Automated Records.
The request is:
POST /evidence HTTP/1.1 Authorization: Bearer <token> Content-Type: application/json; charset=utf-8
The request body MUST be a JSON object that combines the members of a ContentInput object with the members below:
| Member | Type | Required | Description |
|---|---|---|---|
entity_identifier
| string | Yes | The entity identifier of the entity the evidence is associated with. |
classification
| string | No | A classification to assign at creation, one of the values defined in § 10.7.3.3 Classification flag values. Supplying it requires management permissions. It can be replaced with the Classify Evidence method, as specified in § 10.7.6 Classify Evidence. |
A host MUST reject a request whose metadata member is not a JSON
object, whose classification member is not a classification flag,
or whose entity_identifier is missing or malformed with a client
error (HTTP 400).
A successful response is a success response with HTTP 201 Created and a body that is the UUID of the newly created evidence record.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the request body is missing the
entity_identifiermember, the identifier is malformed, metadata is invalid, the content type or context is invalid, or classification is invalid. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold client permissions, or supplies
classificationwithout management permissions. -
HTTP 404 if the entity does not exist.
-
HTTP 500 if the host fails to create the evidence.
10.7.6. Classify Evidence
Method name: classifyEvidence
The Classify Evidence method assigns a classification to an evidence record, replacing its existing classification if it has one. The request MUST be authenticated as an operator with management permissions.
The request is:
PATCH /evidence/{uuid}/classify HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
classification_flag
| string | Yes | The classification to assign, one of the values defined in § 10.7.3.3 Classification flag values. |
When the evidence already has a classification, a host MUST replace it with
classification_flag; a request whose
classification_flag equals the existing classification succeeds
without changing the record. Replacing a classification does not change the
classification of other evidence, the reputation of an entity, or any
blacklist record created when a report was closed.
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, or
classification_flagis absent or invalid. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the evidence does not exist.
-
HTTP 500 if the host fails to classify the evidence.
10.7.7. Get Evidence Record
Method name: getEvidenceRecord
The Get Evidence Record method returns a single evidence record by its UUID. The method is public when the evidence domain is configured as public; otherwise the request MUST present a valid access token. A confidential record is returned only to an authenticated operator with management permissions.
The request is:
GET /evidence/{uuid} HTTP/1.1
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the evidence record. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON EvidenceRecord object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if evidence is not public and the request is not authenticated, or if the evidence is confidential and the request is not authenticated.
-
HTTP 403 if the evidence is confidential and the authenticated operator does not hold management permissions.
-
HTTP 404 if the evidence does not exist.
-
HTTP 500 if the host fails to retrieve the evidence.
10.7.8. Get Evidence Attachments
Method name: getEvidenceAttachments
The Get Evidence Attachments method returns the file attachments associated with an evidence record. The method is public when the evidence domain is configured as public; otherwise the request MUST present a valid access token. A confidential record’s attachments are returned only to an authenticated operator with management permissions.
The request is:
GET /evidence/{uuid}/attachments HTTP/1.1
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the evidence record. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of FileAttachmentRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if evidence is not public and the request is not authenticated, or if the evidence is confidential and the request is not authenticated.
-
HTTP 403 if the evidence is confidential and the authenticated operator does not hold management permissions.
-
HTTP 404 if the evidence does not exist.
-
HTTP 500 if the host fails to retrieve the attachments.
10.7.9. Update Evidence Confidentiality
Method name: updateEvidenceConfidentiality
The Update Evidence Confidentiality method sets or clears the confidentiality
flag of an evidence record. The request MUST be authenticated as an operator
with management permissions. Evidence linked to a report whose incident
type is ILLEGAL_CONTENT MUST remain confidential, as specified in
§ 12.3 Confidential Evidence: a host MUST reject a request that would make such
evidence non-confidential with a conflict error (HTTP 409).
The request is:
PATCH /evidence/{uuid}/update-confidentiality HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the evidence record. |
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
confidential
| boolean | Yes | Whether the evidence should be confidential. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, or the request body is missing the
confidentialmember or it is not a boolean. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the evidence does not exist.
-
HTTP 409 if the request would make evidence linked to an
ILLEGAL_CONTENTreport non-confidential. -
HTTP 500 if the host fails to update the confidentiality.
10.7.10. Update Evidence Tag
Method name: updateEvidenceTag
The Update Evidence Tag method updates the tag of an evidence record. The request MUST be authenticated as an operator with operator permissions.
The request is:
PATCH /evidence/{uuid}/update-tag HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the evidence record. |
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
tag
| string | Yes | The new tag for the evidence, as defined in § 10.7.2.3 Evidence tags. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, or the request body is missing the
tagmember or it is not a valid tag. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold operator permissions.
-
HTTP 404 if the evidence does not exist.
-
HTTP 500 if the host fails to update the tag.
10.7.11. Delete Evidence
Method name: deleteEvidence
The Delete Evidence method permanently deletes an evidence record. The request MUST be authenticated as an operator with management permissions.
The request is:
DELETE /evidence/{uuid} HTTP/1.1
Authorization: Bearer <token>
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the evidence record. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the evidence does not exist.
-
HTTP 500 if the host fails to delete the evidence.
10.7.12. Search Evidence
Method name: searchEvidence
The Search Evidence method searches evidence records by UUID, text content, tag, or associated entity. The method is available only when the host has search enabled and has evidence search enabled. The method is public when the evidence domain is configured as public; otherwise the request MUST present a valid access token. Confidential records are included only when the authenticated operator has management permissions.
The request is:
GET /evidence/search?q={query}&limit={limit}&page={page}&category={category}&by={by}&order={order} HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
q
| Yes | string | The search query. It MUST contain at least two non-whitespace characters after trimming. |
limit
| No | integer | The maximum number of results to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by category, one of the values defined in § 10.7.3.1 Evidence category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.7.3.2 Evidence ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.7.3.2 Evidence ordering values. |
A host MUST reject a request whose q parameter is absent, empty, or
shorter than two non-whitespace characters with a client error (HTTP 400).
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of EvidenceRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the
qparameter is absent, empty, or shorter than two non-whitespace characters. -
HTTP 401 if evidence is not public and the request is not authenticated.
-
HTTP 404 if search is disabled on the host or if evidence search is disabled.
-
HTTP 500 if the host fails to perform the search.
10.8. Blacklist
The blacklist methods operate on the blacklist records of the federated database. A blacklist record is a decision to block an entity; it has an incident type and is either temporary, expiring at a given time, or permanent.
10.8.1. BlacklistRecord object
A BlacklistRecord object represents a single blacklist record. Its members are:
| Member | Type | Description |
|---|---|---|
uuid
| string | The UUID of the blacklist record. |
operator
| string | The UUID of the operator that created the record. |
entity
| string | The UUID of the entity being blacklisted. |
report
| string or null | The UUID of the report supporting the decision, when applicable. The report MAY concern another entity. |
type
| string | The incident type, one of the values defined in § 10.8.1.1 Incident type values. |
lifted
| boolean | Whether the blacklist record has been lifted. |
lifted_by
| string or null | The UUID of the operator that lifted the record, when it was lifted manually. |
created
| integer | The Unix timestamp at which the record was created. |
expires
| integer or null | The Unix timestamp at which a temporary blacklist record expires, or null for a permanent record. |
10.8.1.1. Incident type values
The value of the type member of a BlacklistRecord object, and of
the type parameter of the Blacklist Entity method, is one of the
following uppercase strings:
SPAM-
Spam or automated spam content.
SCAM-
Scam content, such as fraudulent schemes or deceptive practices.
SERVICE_ABUSE-
Abuse of the service, such as harassment or threats.
ILLEGAL_CONTENT-
Content that violates laws or regulations.
MALWARE-
Content or resources intended to spread harmful software, such as viruses.
PHISHING-
Phishing, such as attempts to steal personal information by deception.
ADVERTISING-
Advertising content, or a domain or resource that serves advertisements. Unsolicited advertising sent as messages is
SPAM. TRACKING-
A domain or resource that collects information about users across services, such as a tracking or analytics endpoint.
OTHER-
Other content that does not fit the above categories; intended to be used rarely.
10.8.1.2. Blacklist category values
The value of the category parameter for the list and search methods
is one of the following uppercase strings:
ACTIVE-
Blacklist records that are active and not expired.
LIFTED-
Blacklist records that have been lifted.
EXPIRED-
Blacklist records that have expired without being lifted.
PERMANENT-
Blacklist records that are permanent and have not been lifted.
10.8.1.3. Blacklist ordering values
The value of the by parameter is one of the following uppercase
strings:
TYPE-
Order by the
typemember. EXPIRES-
Order by the
expiresmember. CREATED-
Order by the
createdmember.
The value of the order parameter is one of the following uppercase
strings:
ASC-
Ascending order.
DESC-
Descending order.
10.8.2. List Blacklist
Method name: listBlacklist
The List Blacklist method returns a paginated list of blacklist records. The method is public when the blacklist domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /blacklist HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
limit
| No | integer | The maximum number of blacklist records to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
include_lifted
| No | boolean | Whether to include lifted blacklist records. Defaults to false. Ignored when category is LIFTED, which always selects lifted records.
|
category
| No | string | Filter by category, one of the values defined in § 10.8.1.2 Blacklist category values. |
type
| No | string | A comma-separated list of incident types, as defined in § 10.8.1.1 Incident type values. When present, only blacklist records of one of these types are returned. |
by
| No | string | The member to sort by, one of the values defined in § 10.8.1.3 Blacklist ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.8.1.3 Blacklist ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of BlacklistRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if
typenames a value that is not an incident type. -
HTTP 401 if the blacklist is not public and the request is not authenticated.
-
HTTP 500 if the host fails to retrieve the blacklist records.
10.8.3. Blacklist Entity
Method name: blacklistEntity
The Blacklist Entity method creates a new blacklist record for a known entity. The request MUST be authenticated as an operator with management permissions.
The request is:
POST /blacklist HTTP/1.1 Authorization: Bearer <token> Content-Type: application/json; charset=utf-8
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
entity_identifier
| string | Yes | The entity identifier of the entity to blacklist. |
type
| string | Yes | The incident type, one of the values defined in § 10.8.1.1 Incident type values. |
report_uuid
| string | No | The UUID of the report supporting the decision. |
expires
| integer | No | The Unix timestamp at which the blacklist record expires. If omitted, the record is permanent. |
A host MUST reject a request whose expires member is in the past with
a client error (HTTP 400).
The supporting report MAY concern an entity other than the one being blacklisted, since an incident often implicates several entities: a domain advertised in a spam message, or an alternative account of the sender, can be blacklisted on the strength of the report against the account that sent it, whose evidence the report links. A host MUST NOT reject a request because its report concerns another entity.
A successful response is a success response with HTTP 201 Created and a body that is the UUID of the newly created blacklist record.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the request body is missing a required member, the entity identifier is malformed, the incident type is not defined in § 10.8.1.1 Incident type values, the expires timestamp is in the past, or the report UUID is malformed.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the entity or report does not exist.
-
HTTP 500 if the host fails to create the blacklist record.
10.8.4. Get Blacklist Record
Method name: getBlacklistRecord
The Get Blacklist Record method returns a single blacklist record by its UUID. The method is public when the blacklist domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /blacklist/{uuid} HTTP/1.1
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the blacklist record. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON BlacklistRecord object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the blacklist is not public and the request is not authenticated.
-
HTTP 404 if the blacklist record does not exist.
-
HTTP 500 if the host fails to retrieve the blacklist record.
10.8.5. Delete Blacklist
Method name: deleteBlacklist
The Delete Blacklist method permanently deletes a blacklist record. The request MUST be authenticated as an operator with management permissions.
The request is:
DELETE /blacklist/{uuid} HTTP/1.1
Authorization: Bearer <token>
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the blacklist record. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the blacklist record does not exist.
-
HTTP 500 if the host fails to delete the blacklist record.
10.8.6. Lift Blacklist
Method name: liftBlacklist
The Lift Blacklist method marks a temporary or permanent blacklist record as lifted. The request MUST be authenticated as an operator with management permissions.
The request is:
PATCH /blacklist/{uuid}/lift HTTP/1.1
Authorization: Bearer <token>
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the blacklist record. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, or the blacklist record is already lifted.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the blacklist record does not exist.
-
HTTP 500 if the host fails to lift the blacklist record.
10.8.7. Extend Blacklist
Method name: extendBlacklist
The Extend Blacklist method extends the expiry time of an active temporary blacklist record by a given number of seconds. The request MUST be authenticated as an operator with management permissions. A record whose expiry has passed is no longer active and cannot be extended; an operator blacklists the entity again instead.
The request is:
PATCH /blacklist/{uuid}/extend HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the blacklist record. |
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
seconds
| integer | Yes | The number of seconds to add to the current expiry time. MUST be positive. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, the request body is missing the
secondsmember, it is not a positive integer, the blacklist record is permanent, the blacklist record is already lifted, or it has expired. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the blacklist record does not exist.
-
HTTP 500 if the host fails to extend the blacklist record.
10.8.8. Search Blacklist
Method name: searchBlacklist
The Search Blacklist method searches the blacklist records by the UUID of the record, the UUID of the blacklisted entity, or the entity host or local part of the blacklisted entity. The method is available only when the host has search enabled and has blacklist search enabled. The method is public when the blacklist domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /blacklist/search?q={query}&limit={limit}&page={page}&category={category}&type={types}&by={by}&order={order} HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
q
| Yes | string | The search query. It MUST contain at least two non-whitespace characters after trimming. |
limit
| No | integer | The maximum number of results to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by category, one of the values defined in § 10.8.1.2 Blacklist category values. Search results include lifted records unless a category excludes them. |
type
| No | string | A comma-separated list of incident types, as defined in § 10.8.1.1 Incident type values. When present, only blacklist records of one of these types are returned. |
by
| No | string | The member to sort by, one of the values defined in § 10.8.1.3 Blacklist ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.8.1.3 Blacklist ordering values. |
A host MUST reject a request whose q parameter is absent, empty, or
shorter than two non-whitespace characters with a client error (HTTP 400).
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of BlacklistRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the
qparameter is absent, empty, or shorter than two non-whitespace characters, ortypenames a value that is not an incident type. -
HTTP 401 if the blacklist is not public and the request is not authenticated.
-
HTTP 404 if search is disabled on the host or if blacklist search is disabled.
-
HTTP 500 if the host fails to perform the search.
10.9. Reports
The reports methods operate on the reports of the federated database. A
report documents an incident against an entity, and may be assigned to an
operator for review. Reports are created in the opened state and are closed when
resolved. A host MAY assign a report automatically to an operator that opts in
to it: a report whose automated member is true to an operator whose
configuration has auto_assign_automated_reports set to true, and
any other report to an operator whose configuration has
auto_assign_reports set to true. A host MUST NOT assign a report
automatically to an operator that has not opted in to reports of its kind, and
MUST assign it only to an operator that is enabled and holds management permissions, as required of the target of the Assign Operator to Report
method, so that the assigned operator can close the report. Whether a host
assigns reports automatically, which eligible operator it selects, and when it
does so are internal to the host.
10.9.1. ReportRecord object
A ReportRecord object represents a single report. Its members are:
| Member | Type | Description |
|---|---|---|
uuid
| string | The UUID of the report. |
submitting_operator
| string | The UUID of the operator that submitted the report. |
reporting_entity
| string or null | The UUID of the entity being reported. Despite its name, it identifies the reported entity, not the reporter. It is null for a report that concerns no entity, which only a host can create, under its own policy, since Submit Report requires an entity. |
assigned_operator
| string or null | The UUID of the operator assigned to the report, if any. |
automated
| boolean | Whether the report is automated: created by the host itself or submitted by a bot operator, as specified in § 6.2.1 Automated Records. |
incident_type
| string | The incident type, one of the values defined in § 10.8.1.1 Incident type values. |
opened
| boolean | Whether the report is still open. |
message
| string or null | The message or description of the report. |
created
| integer | The Unix timestamp at which the report was created. |
updated
| integer or null | The Unix timestamp at which the report was last updated. |
10.9.1.1. Report category values
The value of the category parameter for the methods that list or
search reports is one of the following uppercase strings:
OPENED-
Reports that are open.
CLOSED-
Reports that are closed.
AUTOMATED-
Reports that are automated, as specified in § 6.2.1 Automated Records.
UNASSIGNED-
Reports that have no assigned operator.
ASSIGNED-
Reports that have an assigned operator.
10.9.1.2. Report ordering values
The value of the by parameter is one of the following uppercase
strings:
INCIDENT_TYPE-
Order by the
incident_typemember. CREATED-
Order by the
createdmember. UPDATED-
Order by the
updatedmember.
The value of the order parameter is one of the following uppercase
strings:
ASC-
Ascending order.
DESC-
Descending order.
10.9.2. Submit Report
Method name: submitReport
The Submit Report method creates a new report with one or more supporting evidence records for a known entity. The request MUST be authenticated as an operator with client permissions.
The request is:
POST /reports HTTP/1.1 Authorization: Bearer <token> Content-Type: application/json; charset=utf-8
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
reporting_entity
| string | Yes | The entity identifier of the entity being reported. |
evidence
| ContentInput or array of ContentInput | Yes | One non-empty ContentInput object or a non-empty array of non-empty ContentInput objects from which to create evidence records. |
incident_type
| string | Yes | The incident type, one of the values defined in § 10.8.1.1 Incident type values. |
report_message
| string | No | An optional message for the report. |
A host MUST reject a request whose reporting_entity or
evidence member is missing or empty, whose evidence input is not a
non-empty ContentInput object or array of non-empty ContentInput
objects, or whose incident type is invalid with a client error (HTTP 400).
When the incident type is ILLEGAL_CONTENT, the host MUST mark every
evidence record it creates for the report as confidential, regardless of the
confidential member of the submitted ContentInput objects.
A report submitted by a bot operator, and the evidence created for it, are automated, and that evidence is created as confidential, as specified in § 6.2.1 Automated Records.
A host MAY decline to handle illegal content. A host that does so MUST publish
allow_illegal_content as false in its ServerInformation object
and MUST reject every request whose incident type is
ILLEGAL_CONTENT with a permission error (HTTP 403), without
creating a report or any evidence.
A successful response is a success response with HTTP 200 OK and a body that is a JSON ReportSubmission object. The members of a ReportSubmission object are:
| Member | Type | Description |
|---|---|---|
report
| ReportRecord | The report that was created. |
evidence
| array of EvidenceRecord | The evidence records created with the report. |
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the request body is missing a required member, the entity identifier is malformed, the evidence input is invalid, or the incident type is not defined in § 10.8.1.1 Incident type values.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold client permissions, or if the incident type is
ILLEGAL_CONTENTand the host does not accept illegal content. -
HTTP 404 if the reporting entity does not exist.
-
HTTP 500 if the host fails to create the report or evidence.
10.9.3. List Reports
Method name: listReports
The List Reports method returns a paginated list of reports. The method is public when the reports domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /reports HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
limit
| No | integer | The maximum number of reports to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by category, one of the values defined in § 10.9.1.1 Report category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.9.1.2 Report ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.9.1.2 Report ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of ReportRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 401 if reports are not public and the request is not authenticated.
-
HTTP 500 if the host fails to retrieve the reports.
10.9.4. List Opened Reports
Method name: listOpenedReports
The List Opened Reports method returns the reports that are open and assigned to the authenticated operator. The request MUST be authenticated.
The request is:
GET /reports/opened HTTP/1.1 Authorization: Bearer <token>
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
limit
| No | integer | The maximum number of reports to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
by
| No | string | The member to sort by, one of the values defined in § 10.9.1.2 Report ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.9.1.2 Report ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of ReportRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 401 if the request is not authenticated.
-
HTTP 500 if the host fails to retrieve the reports.
10.9.5. Get Report
Method name: getReport
The Get Report method returns a single report by its UUID. The method is public when the reports domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /reports/{uuid} HTTP/1.1
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the report. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON ReportRecord object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if reports are not public and the request is not authenticated.
-
HTTP 404 if the report does not exist.
-
HTTP 500 if the host fails to retrieve the report.
10.9.6. Get Report Evidence Records
Method name: getReportEvidenceRecords
The Get Report Evidence Records method returns the evidence records
associated with a single report. The method is public when the evidence
domain is configured as public; otherwise the request MUST present a valid
access token. When include_confidential is true, the request MUST
be authenticated as an operator with management permissions.
The request is:
GET /reports/{uuid}/evidence HTTP/1.1
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the report. |
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
limit
| No | integer | The maximum number of evidence records to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
include_confidential
| No | boolean | Whether to include confidential evidence records. Defaults to false. |
category
| No | string | Filter by evidence category, one of the values defined in § 10.7.3.1 Evidence category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.7.3.2 Evidence ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.7.3.2 Evidence ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of EvidenceRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if evidence is not public and the request is not authenticated, or if
include_confidentialis true and the request is not authenticated. -
HTTP 403 if
include_confidentialis true and the authenticated operator does not hold management permissions. -
HTTP 404 if the report does not exist.
-
HTTP 500 if the host fails to retrieve the evidence records.
10.9.7. Close Report
Method name: closeReport
The Close Report method closes an opened report. The request MUST be authenticated as an operator with management permissions. The report MUST be assigned to the authenticated operator. A host MAY also create a blacklist record for the reported entity and MAY update the entity’s reputation according to the classification flag.
When a host updates reputation on closing a report, it MAY also update the reputation of existing entities mentioned in the text content of the report’s evidence, identified by the same named entity extraction used by the Scan Content method. A host that does so SHOULD adjust each entity at most once per report, and SHOULD NOT apply the adjustment for mentions to the reported entity a second time. Every positive adjustment, whether to the reported entity or to a mentioned entity, is subject to the incremental limit of § 10.6.2 Reputation. The size of each adjustment is host policy.
The request is:
PATCH /reports/{uuid}/close HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the report. |
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
classification_flag
| string | No | The classification flag to assign to each currently unclassified evidence record linked to the report, one of the values defined in § 10.7.3.3 Classification flag values. Existing classifications MUST NOT be replaced. |
blacklist_incident_type
| string | No | An incident type, one of the values defined in § 10.8.1.1 Incident type values, to create a blacklist record for the reported entity. |
blacklist_expires
| integer | No | The Unix timestamp at which the created blacklist record expires. If omitted, the blacklist record is permanent. Ignored when blacklist_incident_type is absent.
|
A host MUST reject a request whose blacklist_expires member is in the
past, whose classification_flag member is not one of the values
defined in § 10.7.3.3 Classification flag values, whose
blacklist_incident_type member is not one of the values defined in
§ 10.8.1.1 Incident type values, or that supplies blacklist_incident_type
for a report whose reporting_entity is null, with a client error
(HTTP 400).
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, the report is not assigned to the authenticated operator, the report is already closed, or the request contains invalid parameters.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the report does not exist.
-
HTTP 500 if the host fails to close the report.
10.9.8. Delete Report
Method name: deleteReport
The Delete Report method permanently deletes a report. The request MUST be authenticated as an operator with management permissions.
The request is:
DELETE /reports/{uuid} HTTP/1.1
Authorization: Bearer <token>
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the report. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the report does not exist.
-
HTTP 500 if the host fails to delete the report.
10.9.9. Search Reports
Method name: searchReports
The Search Reports method searches the reports by the UUID of the report, its message, or the UUID of the reported entity. The method is available only when the host has search enabled and has report search enabled. The method is public when the reports domain is configured as public; otherwise the request MUST present a valid access token.
The request is:
GET /reports/search?q={query}&limit={limit}&page={page}&category={category}&by={by}&order={order} HTTP/1.1
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
q
| Yes | string | The search query. It MUST contain at least two non-whitespace characters after trimming. |
limit
| No | integer | The maximum number of results to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by category, one of the values defined in § 10.9.1.1 Report category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.9.1.2 Report ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.9.1.2 Report ordering values. |
A host MUST reject a request whose q parameter is absent, empty, or
shorter than two non-whitespace characters with a client error (HTTP 400).
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of ReportRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the
qparameter is absent, empty, or shorter than two non-whitespace characters. -
HTTP 401 if reports are not public and the request is not authenticated.
-
HTTP 404 if search is disabled on the host or if report search is disabled.
-
HTTP 500 if the host fails to perform the search.
10.9.10. Assign Operator to Report
Method name: assignOperatorToReport
The Assign Operator to Report method assigns an operator to a report, replacing any previous assignment. The request MUST be authenticated as an operator with management permissions. The target operator MUST be enabled and MUST hold management permissions. If no operator is specified in the request body, the authenticated operator is assigned. A closed report MUST NOT be assigned.
The request is:
PATCH /reports/{uuid}/assign HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the report. |
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
operator
| string | No | The UUID of the operator to assign. Defaults to the authenticated operator. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, the operator UUID is malformed, the target operator is disabled, or the report is closed.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator or the target operator does not hold management permissions.
-
HTTP 404 if the report or target operator does not exist.
-
HTTP 500 if the host fails to assign the operator.
10.9.11. Add Evidence to Report
Method name: addEvidenceToReport
The Add Evidence to Report method links an existing evidence record to a
report, replacing any report the evidence was previously linked to. The
request MUST be authenticated as an operator with management permissions.
When the report’s incident type is ILLEGAL_CONTENT, the host MUST
mark the linked evidence record as confidential.
The request is:
PATCH /evidence/{uuid}/link-report HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the evidence record. |
The request body MUST be a JSON object containing:
| Member | Type | Required | Description |
|---|---|---|---|
report_uuid
| string | Yes | The UUID of the report to link the evidence to. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID, the UUID is malformed, or the request body is missing the
report_uuidmember or it is not a valid UUID. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the evidence or report does not exist.
-
HTTP 500 if the host fails to link the evidence to the report.
10.10. Attachments
The attachments methods operate on the file attachments of the federated database. A file attachment is a file uploaded as part of an evidence record. Attachments are addressed by their UUID.
10.10.1. FileAttachmentRecord object
A FileAttachmentRecord object represents a single file attachment. Its members are:
| Member | Type | Description |
|---|---|---|
uuid
| string | The UUID of the file attachment. |
evidence
| string or null | The UUID of the evidence record the file is attached to. It is null when the host no longer associates the attachment with an evidence record, as specified in § 6.1 Deletion of Records. |
file_name
| string | The file name of the attachment: the name supplied by the client, or derived from the URL from which the file was retrieved, whether the file was uploaded or recorded from scanned content, reduced to a safe form as specified in § 10.10.4 Upload Attachment. |
file_size
| integer | The size of the file in bytes. |
file_mime
| string | The media type of the file, as determined by the host from the file content. |
created
| integer | The Unix timestamp at which the attachment was uploaded. |
10.10.2. UploadResult object
An UploadResult object is returned when a file is uploaded. Its members are:
| Member | Type | Description |
|---|---|---|
uuid
| string | The UUID of the uploaded file attachment. |
url
| string | The URL at which the file attachment can be downloaded: the Download Attachment route of the uploaded attachment, resolved against the base URL of the host. |
10.10.2.1. Attachment category values
The value of the category parameter for the list and search methods
is one of the following uppercase strings:
IMAGE-
Image files.
DOCUMENT-
Text files and PDF documents.
ARCHIVE-
Archive files such as ZIP, GZIP, TAR, RAR, and 7Z.
10.10.2.2. Attachment ordering values
The value of the by parameter is one of the following uppercase
strings:
FILE_NAME-
Order by the
file_namemember. FILE_MIME-
Order by the
file_mimemember. FILE_SIZE-
Order by the
file_sizemember. CREATED-
Order by the
createdmember.
The value of the order parameter is one of the following uppercase
strings:
ASC-
Ascending order.
DESC-
Descending order.
10.10.3. List Attachments
Method name: listAttachments
The List Attachments method returns a paginated list of file attachments. The request MUST be authenticated as an operator with management permissions.
The request is:
GET /attachments HTTP/1.1 Authorization: Bearer <token>
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
limit
| No | integer | The maximum number of attachments to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by category, one of the values defined in § 10.10.2.1 Attachment category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.10.2.2 Attachment ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.10.2.2 Attachment ordering values. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of FileAttachmentRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 500 if the host fails to retrieve the attachments.
10.10.4. Upload Attachment
Method name: uploadAttachment
The Upload Attachment method stores a file as a file attachment and associates it with an evidence record. The request MUST be authenticated as an operator with client permissions. The file is either uploaded directly in the request body or retrieved by the host from a URL supplied by the client, as specified in § 9.4.3 File Uploads. An operator MAY attach a file only to evidence that it submitted itself, unless it holds management permissions: other evidence, including confidential evidence the operator knows only by its UUID, belongs to another operator, whose submission a file would otherwise alter or publish.
A direct upload is:
POST /attachments HTTP/1.1 Authorization: Bearer <token> Content-Type: multipart/form-data; boundary=<boundary>
A URL upload is, for example:
POST /attachments HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
{
"evidence_uuid": "0190f5a2-7c4e-7b1a-9d3f-2a6c8e4b1f07",
"url": "https://example.com/samples/phishing-page.html"
}
A host MAY also accept the same requests with the HTTP method PUT.
The parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
file
| Conditional | binary | The file to upload, carried as a part of a multipart/form-data body. Required unless url is supplied.
|
url
| Conditional | string | An absolute HTTP or HTTPS URL from which the host retrieves the file. Required unless file is supplied.
|
evidence_uuid
| Yes | string | The UUID of the evidence record to associate the attachment with. |
A host MUST reject a request that supplies both file and
url, or neither of them, and a request whose
evidence_uuid is missing or malformed, with a client error
(HTTP 400).
For a direct upload, a host MUST reject a request whose file part
carries more than one file, or whose file size is zero or exceeds the host’s
configured maximum upload size, with a client error (HTTP 400).
For a URL upload, the host retrieves the file with an HTTP GET request to the
supplied URL. A client SHOULD NOT submit a URL upload to a host that does not
publish allow_url_uploads as true in its ServerInformation
object. A host MAY decline to support URL uploads. A host that does so MUST
publish allow_url_uploads as false and MUST reject every request
that supplies url with a client error (HTTP 400). Otherwise:
-
A host MUST reject a URL that is not an absolute URL with the scheme
httporhttps, or that contains user information, with a client error (HTTP 400). A host MAY enforce a maximum length for the URL. -
A host MUST NOT retrieve a file from an address that is not publicly routable, such as a loopback, private, link-local, or otherwise reserved address, unless the host has been explicitly configured to permit such addresses. The host MUST apply this check to the address it actually connects to, so that a host name resolving to a different address at connection time cannot bypass it, as specified in § 12.5 Remote Retrieval. A URL that is not permitted is rejected with a client error (HTTP 400).
-
A host MAY follow redirects. A host that follows a redirect MUST apply the same checks to its target as to the supplied URL, and SHOULD limit the number of redirects it follows.
-
A host SHOULD bound the time spent retrieving a file, and MUST stop retrieving a file once its size exceeds the host’s configured maximum upload size.
-
A host MUST reject the request with a client error (HTTP 400) when the URL cannot be resolved or connected to, when the retrieval times out, when the final response does not have a 2xx status code, or when the retrieved file is empty or exceeds the host’s configured maximum upload size.
The host determines the media type of the file from its content; it MUST NOT
trust a media type declared by the client or by the server from which a file is
retrieved, since the recorded type is served back in the Content-Type header of
downloads. The file name is the one supplied by the client for a direct upload.
For a URL upload, it is the file name carried in the Content-Disposition
header [RFC6266] of the response when present, and otherwise the last segment
of the path of the URL from which the file was retrieved. The host records the
file name after reducing it to a safe form: it removes any path components and
control characters, and MAY replace other characters and shorten the name. When
no usable file name remains, the host assigns one.
A successful response is a success response with HTTP 201 Created and a body that is a JSON UploadResult object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the request is missing a required parameter, supplies both a file and a URL, the file is invalid, the evidence UUID is malformed, or the URL is not permitted or the file could not be retrieved from it.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold client permissions, or the evidence was submitted by another operator and the authenticated operator does not hold management permissions.
-
HTTP 404 if the evidence record does not exist.
-
HTTP 500 if the host fails to store the file or create the attachment record.
10.10.5. Download Attachment
Method name: downloadAttachment
The Download Attachment method returns the contents of a file attachment. The method is public when the evidence domain is configured as public; otherwise the request MUST present a valid access token. If the attachment’s associated evidence is confidential, or the attachment is no longer associated with evidence, as specified in § 6.1 Deletion of Records, the request MUST be authenticated as an operator with management permissions.
The request is:
GET /attachments/{uuid} HTTP/1.1
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the file attachment. |
A successful response is HTTP 200 OK whose body is the file itself, not a JSON document. The response carries the following headers:
-
Content-Type, set to the media type the host recorded for the file; -
Content-Disposition[RFC6266], set toattachmentwith afilenameparameter carrying the recorded file name, so that user agents save the file instead of rendering it; -
Content-Length, set to the size of the file in bytes; -
Cache-Control[RFC9111], set so that the response is not cached, for exampleno-cache, no-store, must-revalidate; -
X-Content-Type-Options[FETCH], set tonosniff, so that user agents do not infer a different media type from the content of the file.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the evidence domain is not public and the request is not authenticated, or if the attachment’s evidence is confidential or absent and the request is not authenticated.
-
HTTP 403 if the attachment’s evidence is confidential or absent and the authenticated operator does not hold management permissions.
-
HTTP 404 if the attachment or its file does not exist.
-
HTTP 500 if the host fails to retrieve the file.
10.10.6. Get Attachment Info
Method name: getAttachmentInfo
The Get Attachment Info method returns the metadata of a file attachment without returning its contents. The method is public when the evidence domain is configured as public; otherwise the request MUST present a valid access token. If the attachment’s associated evidence is confidential, or the attachment is no longer associated with evidence, as specified in § 6.1 Deletion of Records, the request MUST be authenticated as an operator with management permissions.
The request is:
GET /attachments/{uuid}/info HTTP/1.1
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the file attachment. |
A successful response is a success response with HTTP 200 OK and a body that is a JSON FileAttachmentRecord object.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the evidence domain is not public and the request is not authenticated, or if the attachment’s evidence is confidential or absent and the request is not authenticated.
-
HTTP 403 if the attachment’s evidence is confidential or absent and the authenticated operator does not hold management permissions.
-
HTTP 404 if the attachment does not exist.
-
HTTP 500 if the host fails to retrieve the attachment record.
10.10.7. Delete Attachment
Method name: deleteAttachment
The Delete Attachment method permanently deletes a file attachment and its stored file, including an attachment that is no longer associated with evidence. The request MUST be authenticated as an operator with management permissions.
The request is:
DELETE /attachments/{uuid} HTTP/1.1
Authorization: Bearer <token>
The path parameter is:
| Parameter | Type | Description |
|---|---|---|
uuid
| string | The UUID of the file attachment. |
A successful response is a success response with HTTP 200 OK and a body that is the success envelope.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the path does not contain a UUID or the UUID is malformed.
-
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if the attachment does not exist.
-
HTTP 500 if the host fails to delete the attachment.
10.10.8. Search Attachments
Method name: searchAttachments
The Search Attachments method searches the file attachments by UUID, file name, or associated evidence. The method is available only when the host has search enabled and has attachment search enabled. The request MUST be authenticated as an operator with management permissions.
The request is:
GET /attachments/search?q={query}&limit={limit}&page={page}&category={category}&by={by}&order={order} HTTP/1.1
Authorization: Bearer <token>
The query parameters are:
| Parameter | Required | Type | Description |
|---|---|---|---|
q
| Yes | string | The search query. It MUST contain at least two non-whitespace characters after trimming. |
limit
| No | integer | The maximum number of results to return. A host MAY enforce a maximum and reduce a larger value to that maximum. |
page
| No | integer | The page number for pagination, starting at 1. |
category
| No | string | Filter by category, one of the values defined in § 10.10.2.1 Attachment category values. |
by
| No | string | The member to sort by, one of the values defined in § 10.10.2.2 Attachment ordering values. |
order
| No | string | The sort direction, one of the values defined in § 10.10.2.2 Attachment ordering values. |
A host MUST reject a request whose q parameter is absent, empty, or
shorter than two non-whitespace characters with a client error (HTTP 400).
A successful response is a success response with HTTP 200 OK and a body that is a JSON array of FileAttachmentRecord objects.
A host MUST respond with an error response for the following conditions:
-
HTTP 400 if the
qparameter is absent, empty, or shorter than two non-whitespace characters. -
HTTP 401 if the request is not authenticated.
-
HTTP 403 if the authenticated operator does not hold management permissions.
-
HTTP 404 if search is disabled on the host or if attachment search is disabled.
-
HTTP 500 if the host fails to perform the search.
11. Telemetry
This section is non-normative.
A downstream consumer uses the telemetry a host publishes to decide whether that host is likely to hold useful records about an entity before issuing a query. The Get Server Information method exposes record counts and the public-accessibility information published by the host. A consumer can skip a host whose telemetry indicates that it does not track the kind of record the consumer cares about, or whose published accessibility does not allow the consumer to read it without authentication.
Blacklist records are stronger signals than reputation scores. An active blacklist record represents a deliberate decision by an operator to block an entity, often backed by a report. A consumer can treat a blacklist record as sufficient to block a request, but is never required to do so, and can also weigh the incident type, expiry, and supporting report of the record when deciding how to respond.
A consumer that queries multiple hosts would do well to treat each host as an independent source, subject to the requirements of § 7 Host Policy. Records from different hosts can conflict; a consumer might resolve conflicts by preferring more recent records, records from hosts it trusts more, or records with more supporting evidence, and ought not to assume that all hosts share the same policy or classification criteria.
12. Security Considerations
12.1. Access Tokens
Access tokens are the only credential an operator presents to a host. A host MUST generate access tokens from a cryptographically secure random source, and SHOULD generate them so that each carries at least 128 bits of entropy, for example by drawing every character from the ASCII letters and digits. A host MUST NOT store tokens in plaintext; it MUST store only a one-way representation of each token, such as its SHA-256 digest, from which the token cannot be recovered. Because tokens are long random strings rather than user-chosen secrets, an unsalted cryptographic hash is sufficient. A host MUST NOT expose a token in responses other than those defined to return it, nor in logs or error messages, and SHOULD compare a presented root access token in constant time. A client MUST store tokens securely and SHOULD transmit them only over a confidential channel such as TLS [RFC9846]. If a token is compromised, it can be replaced through the Generate Access Token or Generate Operator Access Token methods, which invalidate the previous token.
12.2. Least Privilege
Permission groups follow the principle of least privilege. A client needs only client permissions to submit records, an operator needs only operator permissions to manage operator accounts, and management tasks require management permissions. A host SHOULD grant each operator the minimum permissions it needs and SHOULD review permissions regularly. Because operator permissions allow an operator to grant any permission group to any operator other than the root and system operators, they are effectively equivalent to full administrative control and SHOULD be granted sparingly.
12.3. Confidential Evidence
Confidential evidence is visible only to operators with management permissions. A host MUST enforce this restriction on read, list, and search operations, including the cross-collection Search method. A host MUST NOT expose a confidential EvidenceRecord, any of its members, or its attachments to an unauthorized requester. Another record MAY contain the confidential evidence UUID as an opaque reference; that reference MUST NOT grant access to the evidence record.
Evidence supporting a report of illegal content is itself likely to be illegal
to distribute. A host therefore MUST mark evidence as confidential when it is
created with, or linked to, a report whose incident type is
ILLEGAL_CONTENT, as specified in § 10.9.2 Submit Report and
§ 10.9.11 Add Evidence to Report, and MUST NOT make such evidence non-confidential
while it remains linked to that report, as specified in
§ 10.7.9 Update Evidence Confidentiality. A host whose operator does not wish to
store such content MAY refuse ILLEGAL_CONTENT reports entirely and
advertises this through the allow_illegal_content member of its
ServerInformation object.
Evidence about a telephone entity typically records private text messages. A host MUST mark the evidence it creates itself about a telephone entity as confidential, as specified in § 6.2.1 Automated Records and § 8.3 Telephone Entities.
12.4. Uploaded Files
File attachments contain content submitted as evidence of abuse and are
likely to include malware, phishing pages, and other hostile content. A host
MUST NOT execute or interpret uploaded files, MUST store them outside any
location from which they could be served other than through the Download
Attachment method, and MUST serve them with Content-Disposition: attachment,
X-Content-Type-Options: nosniff, and a media type it determined itself, as
specified in § 10.10.4 Upload Attachment and § 10.10.5 Download Attachment. A consumer
that downloads an attachment SHOULD treat it as untrusted.
Files submitted to the Scan Content method are equally hostile, and are submitted precisely so that the host interprets them. A host MAY decode such a file, for example to analyze an image, but MUST NOT execute it, MUST NOT retrieve resources it refers to, and MUST NOT keep it after the scan other than as specified in § 10.2.1.1 Scanned files. File formats are a common vector of attacks against the software that decodes them, through malformed structures and through files that expand to far more data than they occupy, such as an image whose declared dimensions require gigabytes of memory. A host SHOULD therefore decode scanned files in an environment isolated from its records and credentials, SHOULD bound the memory, time, and, for images, the dimensions it allows for decoding each file, and SHOULD treat a file that exceeds these bounds as one it cannot interpret.
12.5. Remote Retrieval
A URL upload makes the host send a request to an address chosen by the
client, which an attacker could use to reach services that are only accessible
from the host’s network, such as cloud metadata endpoints, databases, and
administrative interfaces, and to learn about them from the errors and timing of
the responses. A host that supports URL uploads therefore restricts retrieval to
publicly routable addresses unless it has been explicitly configured otherwise,
as specified in § 10.10.4 Upload Attachment. A host SHOULD resolve the host name of a
URL once, validate every resolved address, and connect only to a validated
address, since a host name that is resolved again at connection time may yield a
different address. A host SHOULD NOT route retrieval through a proxy that would
resolve the host name itself, and SHOULD normalize the URL it validated before
using it, so that differences between URL parsers cannot cause it to connect to
a different host. A host whose operator does not wish to make such requests MAY
refuse URL uploads entirely and advertises this through the
allow_url_uploads member of its ServerInformation object. Error
responses to a failed retrieval SHOULD NOT include the content of the remote
response. A file retrieved from a URL is an uploaded file and is subject to
§ 12.4 Uploaded Files.
A host that resolves a DNS name or retrieves a URL while scanning content, as permitted by § 10.2.1 Scan Content and § 7.1 Client Assertions, is exposed to the same risks, since the name or URL is chosen by the requester, and applies the same restrictions. Because Scan Content can be public, such a host is also open to being used to probe or contact third parties on a requester’s behalf; it SHOULD limit the resolutions and retrievals a single request can cause, and MAY reserve them to authenticated requests. Content retrieved this way is hostile in the same way as an uploaded file, and a host MUST NOT execute or render it.
A host that retrieves the files that Scan Content names by URL, as specified in § 10.2.1.2 Scanned file URLs, is exposed to the same risks, and to them on behalf of every requester that can scan content. It applies the restrictions of URL uploads to each retrieval, and does not reveal in its result whether, or why, a file could not be retrieved, so that the results of a scan cannot be used to learn about addresses the host can reach. A host whose operator does not wish to make such requests ignores the file URLs of every request, and a host that retrieves file URLs SHOULD ignore those of unauthenticated requests. A file retrieved this way is a scanned file and is subject to § 12.4 Uploaded Files.
12.6. Abuse of the Database
Because downstream consumers act on the records of a host, the records themselves are a target. An attacker who controls an operator account can blacklist or damage the reputation of legitimate entities. A host SHOULD limit the operators that hold management permissions, and a consumer SHOULD weigh the records of a host according to its trust in that host’s operators and policies, as specified in § 7 Host Policy. Because operators holding client permissions can set entity relationships, and a host MAY decrease the reputation of entities related to a blacklisted entity, an attacker with client permissions can attempt to damage the reputation of a legitimate entity by relating it to an entity that is about to be blacklisted. A host that propagates reputation through entity relationships SHOULD take into account who set a relationship and when. The audit log allows such abuse to be detected and traced after the fact.
An attacker with client permissions can also submit fabricated content, context, or evidence, for example claiming that a legitimate domain serves advertisements, or submit a legitimate entity for scanning many times. A host therefore treats what clients submit as assertions, verifies them where it can, and does not degrade an entity merely because it was submitted, as specified in § 7.1 Client Assertions.
12.7. Resource Exhaustion
Content scanning, search, and URL uploads make a host perform work that is
expensive relative to the request, particularly when scanning causes the host to
resolve names, retrieve URLs, or decode files, and a host can expose the first
two to unauthenticated requests. An attacker can use them to exhaust the
resources of a host. A host publishes the limits it places on the files of a
scan request in max_scan_files and max_scan_file_size,
which also bound the files it retrieves from the file URLs of a request, and
SHOULD ignore the files and file URLs of unauthenticated requests unless it can
bound the work their analysis causes. A host SHOULD limit the rate of requests
it accepts from each requester, as specified in § 9.9 Rate Limiting, and SHOULD
bound the size of request bodies and the work performed for a single request.
Because an unauthenticated requester can change its network address, a host
SHOULD limit unauthenticated requests more strictly than authenticated ones, and
SHOULD limit the requests of groups of addresses, such as a network prefix, as
well as those of each address. A client that ignores the delay of a rate-limited
response adds to the load the limit protects against, and a host MAY lengthen
the delay it gives to, or stop serving, a requester that repeatedly does so.
12.8. Cross-Origin Requests
A host permits cross-origin requests only from origins whose host name equals that of its base URL, as specified in § 9.5.3 Response Headers. Because only the host name is compared, a host that serves other content on the same host name, under another scheme or port, SHOULD consider that content trusted to the same degree as its own. This prevents a web page on an unrelated origin from reading the responses to requests that a user agent sends on an operator’s behalf. It does not protect the access token itself, which a web application MUST NOT expose to untrusted scripts.
13. Privacy Considerations
13.1. Entity Identifiers as Personal Information
An entity address such as john@example.com, and the SHA-256 identifier
derived from it, can be personal information. The SHA-256 identifier is not an
anonymization mechanism: anyone who can guess the address can compute the
identifier and confirm the guess. A host SHOULD consider this before making the
entity registry, reports, blacklist records, or the audit log
public, since each of them can reveal that a particular entity has been
observed, reported, or blocked.
A telephone entity identifies a subscriber more directly than most entity addresses, and the space of telephone numbers is small enough that the SHA-256 identifier of every number can be computed in advance. Looking up a telephone entity by its SHA-256 identifier is therefore as revealing as looking it up by its number. A host hides telephone entities from requests that do not already know the number, as specified in § 8.3 Telephone Entities, and SHOULD limit the rate at which a requester can look up telephone entities individually, as described in § 12.7 Resource Exhaustion, so that the numbers it holds records about cannot be discovered by trying them all.
13.2. Data Minimization and Retention
The protocol does not require a host to collect personal information beyond
the entity identifiers and records that operators choose to submit. Clients
SHOULD NOT submit content, metadata, or attachments that are not needed to
support a decision about an entity. A host SHOULD define and document a
retention policy that limits how long records are kept after they are no longer
relevant, and SHOULD remove expired records under that policy. Entity metadata
and evidence metadata can carry arbitrary attributes about the people behind an
entity; a host SHOULD keep entity metadata private, which is the case unless it
publishes public_entity_metadata as true.
13.3. Operator Records
Operator records are public: any requester can read an operator’s name, permission groups, and account state through the List Operators, Get Operator, and Search Operators methods. The configuration of an operator, such as whether it is a bot operator, is only disclosed to the operator itself and to operators with operator permissions, as specified in § 9.7.4 Visibility Rules. A host SHOULD NOT use an operator name that discloses personal information the operator has not agreed to make public. Operator records never include an access token or its hash.
13.4. Content Scanning
Content submitted to the Scan Content method can contain private communications. A host SHOULD NOT retain scanned content beyond what is needed to produce the scan result and to maintain reputation, unless it creates a report or evidence from that content under a documented policy, as permitted by § 6.2 Population of the Database.
A requester that submits content without authenticating does not thereby
contribute to the federated database, and cannot otherwise learn whether the
host keeps what it submits. A host therefore publishes, in the
collects_public_scan_content member of its ServerInformation
object, whether it may store content submitted to the Scan Content method by
unauthenticated requests, or records derived from that content, such as the
evidence and reports it creates automatically, in its federated database. A host that does so, or whose configuration or extensions permit it
to do so, MUST publish the member as true; a host that does not store such
content beyond what is needed to produce the scan result MUST publish it as
false. A host that does not make content scanning public publishes it as false.
Content submitted by an authenticated operator is submitted to contribute to
the database, and is not described by this member. A client SHOULD inform the
users whose content it submits without authenticating when a host publishes the
member as true.
Content of the HOSTNAME, URL, and
WEB_PAGE content types reveals what the user of a device
visited or looked up, which can be as sensitive as the content of a message. A
client SHOULD submit such content only with the consent of that user, and
SHOULD NOT submit names or URLs that identify private networks, devices, or
resources. A URL can carry a token that identifies its recipient, or that
performs an action such as confirming a subscription when it is requested. A
host that retrieves a URL while scanning therefore reveals to the remote party
that the content was received, and can trigger such an action; it SHOULD
retrieve URLs only with the GET method and without credentials or cookies, and
SHOULD NOT retrieve URLs found within TEXT or EMAIL
content.
Files submitted for scanning can be more revealing than the text they
accompany. An image can show the faces, documents, or surroundings of people
other than its author, and many file formats carry metadata, such as the
location at which a photograph was taken, the device that took it, or the name
of the person who edited a document. A host that records scanned files as
evidence SHOULD treat such metadata as personal information, and a client
MAY remove metadata that the host does not need before submitting a file. A
client SHOULD NOT submit files that the users whose content it scans could not
expect to be analyzed, and SHOULD inform them when it submits files without
authenticating to a host that publishes collects_public_scan_content
as true.
A file URL can identify the recipient of the content, or carry a token that grants access to the file or performs an action when it is requested, as the URL of a tracking image does. A host that retrieves a file URL therefore reveals to the remote party that the content was received and scanned, and from which network. A client SHOULD name only the URLs at which the files of the content are held, SHOULD NOT name URLs that carry the credentials of its users or that identify private networks, devices, or resources, and SHOULD carry such files in the request instead. A host SHOULD retrieve file URLs only with the GET method and without credentials or cookies.
13.5. Public Accessibility
Public accessibility is a host decision. A host MAY expose any configurable domain of the federated database publicly, but it SHOULD consider the sensitivity of the records before doing so, and it SHOULD publish accurate accessibility information so that consumers can make informed choices.
A downstream consumer makes the final decision about how to treat an entity. The host is responsible for the integrity and access control of its data; the consumer is responsible for interpreting that data according to its own policy and for protecting the privacy of the users it serves.
14. Acknowledgements
This section is non-normative.
The Open Federated Database Specification was developed by the OFD community and the contributors to the nosial/OFD-Specification repository. The editor thanks everyone who reviewed drafts, reported issues, and contributed improvements to the protocol and its documentation.