/rf-api:rf-restinstancefrom rf-api
Use first, before answering, for RF API tests with RESTinstance: JSON Schema. Not installs: rf-setup.
Ships in rf-api. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
RESTinstance (Library REST) sends JSON requests and asserts the last response with typed, path-based keywords that also build a JSON Schema of it.
Prefer it over rf-requests when the contract matters more than single values: schema files, learned schemas, OpenAPI specs, types and constraints.
For plain request/response checks, form posts, sessions or file uploads use rf-requests.
Verified against RESTinstance 1.8.0, Robot Framework 7.4.
Load this skill first, before exploring the project or answering from memory, when a Robot Framework API test uses RESTinstance (Library REST):
Not this skill: suites that import RequestsLibrary, or generic API tests with no library named, use rf-requests.
Install into the project environment, with the tool the project already uses. Full steps and verification: references/install.md. For a new environment, Poetry and venv + pip forms, and troubleshooting, see rf-setup (plugin rf-core).
uv add RESTinstance
Requires Python ≥ 3.11; the SyntaxWarning lines printed on import (from flex) are harmless.
Import with the base URL, send paths, and assert the status first on every request:
*** Settings ***
Library REST ${API_URL}
*** Test Cases ***
Get User
GET /users/1
Integer response status 200
Object response body required=["id", "name"]
String response body name Alice
Integer response body id minimum=1
${API_URL} has to exist when the library is imported (*** Variables *** or --variable). A URL without scheme gets http://.
Escape hatch: when the base URL is only known at run time (a Suite Setup starts the server), import REST without a URL and send full URLs (GET ${API_URL}/users/1). Schema files and OpenAPI specs: see references/schema-validation.md.
| Situation | Use | Details |
|---|---|---|
| Send a request | GET / POST /users {"name": "Bo"} / PUT / PATCH / DELETE | references/json-handling.md |
| Query string, per-request headers, timeout | GET /users query={"page": "2"} headers={...} timeout=5 | — |
| Assert status | Integer response status 200 (several values = any of them) | — |
| Assert a field's type, value or constraint | String response body email format=email, Integer $[*].id minimum=1 | references/json-handling.md |
| Assert a field is absent or null | Missing response body error, Null response body deleted_at | — |
| Read a value for the next request | ${id}= Output response body id also_console=false | references/json-handling.md |
| Validate against a schema file | Expect Response Body ${CURDIR}/schemas/user.json before the request | references/schema-validation.md |
| Learn a schema from a real response | Output Schema response body file_path=... | references/schema-validation.md |
| Stop schema validation | Clear Expectations, or validate=false on one request | references/schema-validation.md |
| Headers for all later requests | Set Headers {"Authorization": "Bearer ${TOKEN}"} | references/authentication.md |
| Basic/digest auth, client certificate | Set Client Authentication, Set Client Cert | references/authentication.md |
| Self-signed TLS in a test environment | Set SSL Verify false | references/troubleshooting.md |
| See what the response looks like | Output response body, Output Schema | — |
| Dump every request and response of the suite | REST Instances ${OUTPUT DIR}/instances.json | references/troubleshooting.md |
Paths start at the last instance: response status, response body user name, response body items 0 id, response headers Content-Type, or JSONPath rooted at the body ($.items[*].id).
robotcode doc keyword REST "<Keyword>"; find names with robotcode doc keywords REST "<text>". Copy names and arguments exactly as robotcode shows them.robotcode analyze code <changed files> (through the project environment, e.g. uv run robotcode …). Fix every error it reports.robotcode robot -bl "<Suite.Sub.Test>" (longnames from robotcode discover tests), or pass a whole directory. Don't pass a single .robot file: it skips the parent __init__.robot.robotcode results show --failed, then robotcode results log -bl "<longname>". Don't parse output.xml by hand.GET returns normally on 404 or 500, because RESTinstance only records the response as a new instance. Assert Integer response status 200 (or the expected error status) after every request.String response body name Ali* fails on Alice, and /regex/ is compared literally, because extra arguments become the schema's enum. Write String response body name pattern=^Ali, or list every allowed value (Integer response status 200 201).json.loads, so pattern=^\\d+ fails with Input not is valid JSON, and a single-quoted body ({'a': 1}) is sent as one JSON string. Write pattern=^\\\\d+ (or [0-9]) and bodies as double-quoted JSON or a &{dict}.Object response body {"type": "object"} compares the body with that dict and fails. Use validation arguments (Object response body required=["id"]) or Expect Response Body with a schema.Expect Response Body, Expect Response and Expect Request change the library instance, which lives for the whole suite (ROBOT_LIBRARY_SCOPE = "TEST SUITE"), so every later request in the suite is validated against them and fails the HTTP keyword itself. Set them in the test that needs them and end it with Clear Expectations (or use them on purpose in Suite Setup).Set Headers and Set Client Authentication update the instance's request defaults, so a token set in one test is sent by all later tests. Use headers= on a single request, or reset with Set Client Authentication ${NONE}.${id}= Integer response body id stores [1], because the keyword returns every match of the path. Use ${id}= Output response body id also_console=false for a single value (or ${id}[0]).Output and Output Schema print to the console — also_console=True by default, which floods CI logs. Pass also_console=false once the paths are known.| Read | When |
|---|---|
| references/install.md | installing the library, its post-install steps, verifying the install, or a failed post-install step |
| references/migrate-from-requests.md | a suite moves from RequestsLibrary to RESTinstance: the keyword map |
| references/json-handling.md | Writing field paths, JSONPath, validation arguments, or chaining values between requests |
| references/schema-validation.md | Using schema files, learning schemas with Output Schema, expectations, or an OpenAPI spec= |
| references/authentication.md | Adding tokens, API keys, basic/digest auth or client certificates |
| references/troubleshooting.md | A request or assertion fails with an error you don't understand |
Examples in assets/examples/: basic-rest.robot (requests, paths, chaining, negative status), schema-validation.robot (learned schema, schema file, expectations).
| Need | Skill |
|---|---|
| API tests with RequestsLibrary | rf-requests |
| Install Robot Framework or a library, fix the environment | rf-setup (plugin rf-core) |
| Write tests, suites, user keywords, resources and variables in Robot Framework syntax | rf-language (plugin rf-core) |
For running, discovering, keyword documentation, result analysis and debugging with the robotcode CLI, use the robotcode skill of the robotcode plugin (robotcode@robotframework-agent-plugins); the commands above work without it.
assets/examples/basic-rest.robot (opens in a new tab)assets/examples/schema-validation.robot (opens in a new tab)assets/examples/schemas/user.json (opens in a new tab)references/authentication.md (opens in a new tab)references/install.md (opens in a new tab)references/json-handling.md (opens in a new tab)references/migrate-from-requests.md (opens in a new tab)references/schema-validation.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub marketsquare/robotframework-plugins --plugin rf-api2 skills in this plugin