[role="xpack"]
[[clear-sql-cursor-api]]
=== Clear SQL cursor API
++++
<titleabbrev>Clear SQL cursor</titleabbrev>
++++

.New API reference
[sidebar]
--
For the most up-to-date API details, refer to {api-es}/group/endpoint-sql[SQL APIs].
--

Clears an <<sql-pagination,SQL search cursor>>.

////
[source,console]
----
POST _sql
{
  "query": "SELECT * FROM library ORDER BY page_count DESC",
  "fetch_size": 5
}
----
// TEST[setup:library]
////

[source,console]
----
POST _sql/close
{
  "cursor": "sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f///w8="
}
----
// TEST[continued]
// TEST[s/sDXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAEWYUpOYklQMHhRUEtld3RsNnFtYU1hQQ==:BAFmBGRhdGUBZgVsaWtlcwFzB21lc3NhZ2UBZgR1c2Vy9f\/\/\/w8=/$body.cursor/]

[[clear-sql-cursor-api-request]]
==== {api-request-title}

`POST _sql/close`

[[clear-sql-cursor-api-limitations]]
===== Limitations

See <<sql-limitations>>.

[role="child_attributes"]
[[clear-sql-cursor-api-request-body]]
==== {api-request-body-title}

`cursor`::
(Required, string) Cursor to clear.
