# HTTP JSON Endpoints

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
```