HTTP interface for search-alias Views
The HTTP API for Views lets you manage search-alias Views, including adding and removing inverted indexes
Create a search-alias View
POST
/_db/{database-name}/_api/view
Creates a new View with a given name and properties if it does not
already exist.
Query Parameters
HTTP Headers
Request Body application/json object
Responses
Examples
curl -X POST --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/view' <<'EOF'
{
  "name": "products",
  "type": "search-alias",
  "indexes": [
    {
      "collection": "books",
      "index": "inv-idx"
    }
  ]
}
EOFShow output
HTTP/1.1 201 Created
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 148
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "globallyUniqueId" : "h875A911E530B/75321", 
  "id" : "75321", 
  "name" : "products", 
  "type" : "search-alias", 
  "indexes" : [ 
    { 
      "collection" : "books", 
      "index" : "inv-idx" 
    } 
  ] 
}Get information about a View
GET
/_db/{database-name}/_api/view/{view-name}
Returns the basic information about a specific View.
Path Parameters
Query Parameters
HTTP Headers
Responses
Examples
Using an identifier:
curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/view/75329'Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 124
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "error" : false, 
  "code" : 200, 
  "type" : "arangosearch", 
  "name" : "productsView", 
  "id" : "75329", 
  "globallyUniqueId" : "h875A911E530B/75329" 
}Using a name:
curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/view/productsView'Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 124
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "error" : false, 
  "code" : 200, 
  "type" : "arangosearch", 
  "name" : "productsView", 
  "id" : "75333", 
  "globallyUniqueId" : "h875A911E530B/75333" 
}Read properties of a View
GET
/_db/{database-name}/_api/view/{view-name}/properties
Returns an object containing the definition of the View identified by 
view-name.Path Parameters
Query Parameters
HTTP Headers
Responses
Examples
Using an identifier:
curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/view/75349/properties'Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 177
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "error" : false, 
  "code" : 200, 
  "type" : "search-alias", 
  "name" : "productsView", 
  "indexes" : [ 
    { 
      "collection" : "books", 
      "index" : "inv-idx" 
    } 
  ], 
  "id" : "75349", 
  "globallyUniqueId" : "h875A911E530B/75349" 
}Using a name:
curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/view/productsView/properties'Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 177
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "error" : false, 
  "code" : 200, 
  "type" : "search-alias", 
  "name" : "productsView", 
  "indexes" : [ 
    { 
      "collection" : "books", 
      "index" : "inv-idx" 
    } 
  ], 
  "id" : "75369", 
  "globallyUniqueId" : "h875A911E530B/75369" 
}List all Views
GET
/_db/{database-name}/_api/view
Returns an object containing a listing of all Views in the current database,
regardless of their type.
Query Parameters
HTTP Headers
Responses
Examples
Return information about all Views:
curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/view'Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 328
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "error" : false, 
  "code" : 200, 
  "result" : [ 
    { 
      "globallyUniqueId" : "h875A911E530B/179", 
      "id" : "179", 
      "name" : "demoView", 
      "type" : "arangosearch" 
    }, 
    { 
      "globallyUniqueId" : "h875A911E530B/75377", 
      "id" : "75377", 
      "name" : "productsView", 
      "type" : "search-alias" 
    }, 
    { 
      "globallyUniqueId" : "h875A911E530B/75378", 
      "id" : "75378", 
      "name" : "reviewsView", 
      "type" : "arangosearch" 
    } 
  ] 
}Replace the properties of a search-alias View
PUT
/_db/{database-name}/_api/view/{view-name}/properties
Replaces the list of indexes of a 
search-alias View.Path Parameters
Query Parameters
HTTP Headers
Request Body application/json object
Responses
Examples
curl -X PUT --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/view/productsView/properties' <<'EOF'
{
  "indexes": [
    {
      "collection": "books",
      "index": "inv_descr"
    }
  ]
}
EOFShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 154
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "globallyUniqueId" : "h875A911E530B/75399", 
  "id" : "75399", 
  "name" : "productsView", 
  "type" : "search-alias", 
  "indexes" : [ 
    { 
      "collection" : "books", 
      "index" : "inv_descr" 
    } 
  ] 
}Update the properties of a search-alias View
PATCH
/_db/{database-name}/_api/view/{view-name}/properties
Updates the list of indexes of a 
search-alias View.Path Parameters
Query Parameters
HTTP Headers
Request Body application/json object
Responses
Examples
curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/view/productsView/properties' <<'EOF'
{
  "indexes": [
    {
      "collection": "books",
      "index": "inv_descr"
    }
  ]
}
EOFShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 197
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "globallyUniqueId" : "h875A911E530B/75423", 
  "id" : "75423", 
  "name" : "productsView", 
  "type" : "search-alias", 
  "indexes" : [ 
    { 
      "collection" : "books", 
      "index" : "inv_title" 
    }, 
    { 
      "collection" : "books", 
      "index" : "inv_descr" 
    } 
  ] 
}Rename a View
PUT
/_db/{database-name}/_api/view/{view-name}/rename
Renames a View.
Renaming Views is not supported in cluster deployments.
Path Parameters
Query Parameters
HTTP Headers
Responses
Examples
curl -X PUT --header 'accept: application/json' --data-binary @- --dump - 'http://localhost:8529/_api/view/productsView/rename' <<'EOF'
{
  "name": "catalogView"
}
EOFShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 495
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "globallyUniqueId" : "h875A911E530B/75431", 
  "id" : "75431", 
  "name" : "catalogView", 
  "type" : "arangosearch", 
  "cleanupIntervalStep" : 2, 
  "commitIntervalMsec" : 1000, 
  "consolidationIntervalMsec" : 5000, 
  "consolidationPolicy" : { 
    "type" : "tier", 
    "segmentsBytesFloor" : 25165824, 
    "segmentsBytesMax" : 8589934592, 
    "segmentsMax" : 200, 
    "segmentsMin" : 50, 
    "minScore" : 0 
  }, 
  "optimizeTopK" : [ ], 
  "primarySort" : [ ], 
  "primarySortCompression" : "lz4", 
  "storedValues" : [ ], 
  "writebufferActive" : 0, 
  "writebufferIdle" : 64, 
  "writebufferSizeMax" : 33554432, 
  "links" : { 
  } 
}Drop a View
DELETE
/_db/{database-name}/_api/view/{view-name}
Deletes the View identified by 
view-name.Path Parameters
Query Parameters
HTTP Headers
Responses
Examples
Using an identifier:
curl -X DELETE --header 'accept: application/json' --dump - 'http://localhost:8529/_api/view/75437'Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 40
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "error" : false, 
  "code" : 200, 
  "result" : true 
}Using a name:
curl -X DELETE --header 'accept: application/json' --dump - 'http://localhost:8529/_api/view/productsView'Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 40
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{ 
  "error" : false, 
  "code" : 200, 
  "result" : true 
}
