> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# HTTP JSON Endpoints

> Define HTTP JSON endpoints in the Fern Definition under the endpoints key, including path, method, request bodies, responses, and examples.

Fern Definition isn't recommended for new customers and Fern isn't accepting feature requests for this format. It remains supported for existing users.

Endpoints in Fern are defined underneath the `endpoints` key. Below is an example of defining
a single REST endpoint:

```yml title="users.yml" maxLines=0
service: 
  base-path: /users 
  auth: false 
  endpoints: 
    createUser: 
      path: /create 
      method: POST 
      request: 
        body: 
          properties: 
            userName: string
```

## Examples

You can provide examples of requests and responses by using the `examples` key.

```yaml {11-17}
service:
  base-path: /users
  auth: false
  endpoints:
    getUser:
      path: /{userId}
      path-parameters:
        userId: string
      method: GET
      response: User
      examples:
        - path-parameters:
            userId: alice-user-id
          response:
            body:
              userId: alice-user-id
              name: Alice
```