Using the REST API reference (2024)

Use the REST API Reference to learn about available endpoints and operations for accessing, creating, updating, or deleting resources. See the REST API User Manual to learn about the Splunk REST API basic concepts.

See the Endpoints reference list for an alphabetical list of endpoints.

Splunk Cloud Platform REST API usage

There are some REST API access and usage differences between Splunk Cloud Platform and Splunk Enterprise. If you are using Splunk Cloud Platform, review details in Access requirements and limitations for the Splunk Cloud Platform REST API.

Splunk REST API admin endpoints

Splunk does not support or document REST API endpoints that contain /admin/ in their URIs. Use the corresponding publicly documented endpoint instead.

Resource groups

Resources are grouped into the following categories.

CategoryDescription
Access controlAuthorize and authenticate users.
ApplicationsInstall applications and application templates.
ClustersConfigure and manage indexer clusters and search head clusters.
ConfigurationManage configuration files and settings.
DeploymentManage deployment servers and clients.
InputsManage data input.
IntrospectionAccess system properties.
KnowledgeDefine indexed and searched data configurations.
KV storeManage app key-value store.
LicensingManage licensing configurations.
OutputsManage forwarder data configuration.
SearchManage searches and search-generated alerts and view objects.
SystemManage server configuration.
Workload managementManage system resources for search workloads.

See the Endpoints reference list for an alphabetical list of endpoints.

Available operations

Depending on the endpoint, GET, POST, and/or DELETE operations are available for accessing, creating, updating, or deleting resources. Some operations have specific capability requirements, as noted.

Using endpoint reference entries

Reference information for each endpoint in the REST API includes the following items.

  • URL
  • Usage details
  • Expandable elements showing available operations (GET, POST, and/or DELETE) for the endpoint.


Expand a GET, POST, or DELETE element to show the following usage information about the operation.

  • Request parameter information and requirements.
  • Returned values included in the response.
  • Example request and response.

Request and response details

Pagination and filtering parameters

In addition to the parameters specific to each endpoint and operation, the following request parameters are valid for some GET methods.

NameDatatypeDefaultDescription
countNumber30Maximum number of entries to return. Set value to 0 to get all available entries.
fStringFilters the response to include the items that have only the specified fields. Specify multiple times to return multiple fields.

Examples:

  • f=qualifiedSearch returns only the qualifiedSearch field.
  • f=s* returns all the fields that begin with s.
  • f=qualifiedSearch&f=is_visible returns the fields for qualifiedSearch and is_visible.
offsetNumber0Index of first item to return.
searchStringResponse filter, where the response field values are matched against this search expression.

Examples:

  • search=foo matches on any field with the string foo in the name.
  • search=field_name%3Dfield_value restricts the match to a single field. (Requires URI-encoding.)
sort_dirEnumascResponse sort order:
  • asc = ascending
  • desc = descending
sort_keyStringnameField name to use for sorting.
sort_modeEnumautoCollated ordering:
  • auto = If all field values are numeric, collate numerically. Otherwise, collate alphabetically.
  • alpha = Collate alphabetically, not case-sensitive.
  • alpha_case = Collate alphabetically, case-sensitive.
  • num = Collate numerically.
summarizeBoolfalseResponse type:
  • true = Summarized response, omits some index details, but provides a faster response.
  • false = full response.

Returned values

The response to GET and other requests typically includes key-value pairs representing details about the resource that you are accessing. Returned values specific to the resource and/or operation are listed along with their descriptions.

HTTP status codes

Responses can include HTTP status codes. Standard HTTP status codes are not included in endpoint documentation, but status codes with specific meaning for an endpoint and/or operation are noted.

Error messages

Requests with an error, such as a missing required parameter, can prompt an error response like the following example.

<response> <messages> <msg type="ERROR"> In handler 'datamodelgenerate': The following required arguments are missing: sid. </msg> </messages></response>

EAI response data

EAI response data, the <eai:acl> and <eai:attributes> elements, typically apply to all endpoints and are configuration-dependent, so redundant explanation is omitted. These elements are also elided from the response examples to make the documentation easier to read.

Access Control List (ACL) [eai:acl]

The REST implementation enforces ownership and permissions for a resource based on application context namespace. The ACL includes the following parameters.

ParameterDescription
appThe app context for the resource. Allowed values are:
  • The name of an app
  • system
can_listFor internal use only for the Splunk Web manager UI.
can_share_*Indicates whether or not the current user can change the sharing state. The sharing state can be one of:
  • can_share_app = App-level sharing
  • can_share_global = Global sharing
  • can_share_user = User-level sharing
can_writeIndicates whether or not the current user can edit this item.
ownerThe user that owns the resource.

A value of nobody indicates that all users have access to the resource, but that write access to the resource might be restricted.

modifiableIndicates whether or not you can change the Access Control List (ACL).

Set to false for items not controlled by ACLs, such as items under /server/logger.

perms.readProperties that indicate read permissions of the resource.
perms.writeProperties that indicate write permissions of the resource.
removableIndicates if an admin or user with sufficient permissions can remove the entity.
sharingIndicates how the resource is shared. Allowed values are:
  • app = Shared through an app.
  • global = Shared to all apps.
  • user = Private to a user.

Note: You can append /_acl to an endpoint to access its ACL properties. For more information, see Access Control List in the REST API User Manual.


EAI attributes [eai:attributes]

The eai:attributes element shows the mandatory and optional fields.

AttributeDescription
optionalFieldsField is optional.
requiredFieldsField is required.
wildcardFieldsField can use wildcard.

References

See the following resources for more information on working with the Splunk REST API.

  • REST API User Manual
  • REST API Tutorials

Last modified on 16 July, 2024

Endpoints reference list

This documentation applies to the following versions of Splunk® Enterprise: 7.2.0, 7.2.1, 7.2.2, 7.2.3, 7.2.4, 7.2.5, 7.2.6, 7.2.7, 7.2.8, 7.2.9, 7.2.10, 7.3.0, 7.3.1, 7.3.2, 7.3.3, 7.3.4, 7.3.5, 7.3.6, 7.3.7, 7.3.8, 7.3.9, 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 8.0.7, 8.0.8, 8.0.9, 8.0.10, 8.1.0, 8.1.1, 8.1.2, 8.1.3, 8.1.4, 8.1.5, 8.1.6, 8.1.7, 8.1.8, 8.1.9, 8.1.10, 8.1.11, 8.1.12, 8.1.13, 8.1.14, 8.2.0, 8.2.1, 8.2.2, 8.2.3, 8.2.4, 8.2.5, 8.2.6, 8.2.7, 8.2.8, 8.2.9, 8.2.10, 8.2.11, 8.2.12, 9.0.0, 9.0.1, 9.0.2, 9.0.3, 9.0.4, 9.0.5, 9.0.6, 9.0.7, 9.0.8, 9.0.9, 9.0.10, 9.1.0, 9.1.1, 9.1.2, 9.1.3, 9.1.4, 9.1.5, 9.2.0, 9.2.1, 9.2.2, 9.3.0

Using the REST API reference (2024)

FAQs

What is REST API reference? ›

Representational State Transfer (REST) APIs are service endpoints that support sets of HTTP operations (methods), which provide create, retrieve, update, or delete access to the service's resources.

What is an API reference? ›

API docs, or API description documents, are the collection of references, tutorials, and examples that help developers use your API. Your API's documentation is the primary resource for explaining what is possible with your API and how to get started.

How to call API using REST API? ›

Calling REST APIs
  1. Add a Datasource with OpenAPI specification. Datasource for REST service without OpenAPI specification.
  2. Add a service. Define the methods that map to the operations.
  3. Add a Controller. Inject the Service in the constructor. Add the REST endpoints.
  4. More examples.
  5. Further reading.

How to pull data using REST API? ›

To retrieve API data using a REST client, follow these steps:
  1. Choose a REST client tool or library suitable for your project's requirements and language.
  2. Set the HTTP method (usually GET for retrieving data) and provide the API endpoint URL.
  3. Configure any required headers, such as API keys or authentication tokens.
Jul 22, 2024

What is a REST API give an example? ›

REST APIs communicate through HTTP requests to perform standard database functions like creating, reading, updating and deleting records (also known as CRUD) within a resource. For example, a REST API would use a GET request to retrieve a record. A POST request creates a new record.

Is a REST API just a URL? ›

A RESTful web service request contains: An Endpoint URL. An application implementing a RESTful API will define one or more URL endpoints with a domain, port, path, and/or query string — for example, https://mydomain/user/123?format=json .

How to give API reference? ›

At minimum, an API reference should contain a guide called "Using the name-of-api", which will provide a basic guide to how to use the API. More complex APIs may require multiple usage guides to explain how to use different aspects of the API.

What is reference data API? ›

The reference data API offers central source for any kind Eurex reference data, machine- and human readable format. No more downloading, polling and parsing of multiple files. API is based on GraphQL and JSON standards, which gives you flexibility retrieving data you need, without overfetching.

What is API reference standard? ›

Mikromol's reference standards for active pharmaceutical ingredients (APIs) are primary quantitative standards – most of them are accredited to ISO 17034 standards and designed to ensure the highest analytical accuracy and reliability.

What is the difference between API and REST API? ›

REST APIs use HTTP/HTTPS, while Web APIs use protocols like SOAP and BEEP in addition to HTTP/HTTPS. Protocol choice can impact speed and security, so it's important to consider this when selecting an API.

Why do we use REST API? ›

Systems that implement REST APIs can scale efficiently because REST optimizes client-server interactions. Statelessness removes server load because the server does not have to retain past client request information. Well-managed caching partially or completely eliminates some client-server interactions.

What are REST API commands? ›

REST API Commands
  • start.
  • stop.
  • pause.
  • resume.
  • details.
  • download.
  • redirect.
  • delete.

What is an example of an API call? ›

Suppose someone searches for bus tickets on a travel website. The travel website sends an API call to the various bus companies' servers and receives back information about what rides are available and how much they cost. From the user's perspective, this process should be almost instantaneous.

How does REST API send data? ›

REST API concepts

To get access to a resource, the client sends an HTTP request. In return, the server generates an HTTP response with encoded data on the resource. Both types of REST messages are self-descriptive, meaning they contain information on how to interpret and process them.

What are the 4 components of REST API? ›

REST API methods and request structure

Any REST request includes four essential parts: an HTTP method, an endpoint, headers, and a body.

What is REST API source? ›

A REST API source allows you to index content from repositories exposing their data through a REST API. When creating your REST API source, you must provide a JSON configuration allowing Coveo to retrieve content items.

What the heck is REST API? ›

A RESTful API is an architectural style for an application programming interface that uses HTTP requests to access and use data. That data can be used to GET , PUT , POST and DELETE data types, which refers to reading, updating, creating and deleting operations related to resources.

References

Top Articles
Latest Posts
Article information

Author: Greg Kuvalis

Last Updated:

Views: 5659

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Greg Kuvalis

Birthday: 1996-12-20

Address: 53157 Trantow Inlet, Townemouth, FL 92564-0267

Phone: +68218650356656

Job: IT Representative

Hobby: Knitting, Amateur radio, Skiing, Running, Mountain biking, Slacklining, Electronics

Introduction: My name is Greg Kuvalis, I am a witty, spotless, beautiful, charming, delightful, thankful, beautiful person who loves writing and wants to share my knowledge and understanding with you.