> ## Documentation Index
> Fetch the complete documentation index at: https://docs.silnahealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Rate Type

A rate type is the service a rate is for, such as `97110` or `Initial Evaluation`. Rate types belong to a provider or MSO, and every rate references one. Create a rate type once, then reuse its `id` as the `rate_type_id` for as many rates as you need, across payors, specialties, and states.

Send exactly one of `provider_id` or `mso_id`.

### Name

`name` is what patients see as the service name on benefits check cost estimates, including benefits check reports. Use a name they will recognize. It must be 1 to 50 characters, and leading and trailing spaces are removed.

### Duration

`duration` is the unit of time the rate amount is for. If you leave it out, it defaults to `PER_VISIT`.

| Value | Shown on cost estimates as |
| - | - |
| `PER_VISIT` | Per Visit |
| `PER_HOUR` | Per Hour |
| `PER_DAY` | Per Day |
| `PER_WEEK` | Per Week |
| `PER_MONTH` | Per Month |
| `PER_SESSION` | Per Session |
| `PER_PHASE` | Per Phase |
| `NONE_HIDDEN` | Nothing. The duration is hidden |

When a patient's copay applies, the cost estimate shows that service as Per Visit, whatever the rate type's duration is.

### Duplicates

A provider or MSO can't have two rate types with the same `name` and `duration`. Creating one returns a `409`; use the [Get Rate Types API](https://docs.silnahealth.com/api-reference/v1ratetypesresource/get-rate-types.md) to find the existing one. The same name with a different duration is allowed, for example `97110` with `PER_VISIT` and `97110` with `PER_HOUR`.

### Changing a rate type

Use the [Update Rate Type API](https://docs.silnahealth.com/api-reference/v1ratetyperesource/update-rate-type.md) to rename a rate type or change its duration, and the [Delete Rate Type API](https://docs.silnahealth.com/api-reference/v1ratetyperesource/delete-rate-type.md) to remove one that no rates use.

### Example

To create an hourly rate type for a provider, replace the example ID with your own:

```
{
  "provider_id": "0194a843-5821-70e2-bbe9-0f986c05984d",
  "name": "97110",
  "duration": "PER_HOUR"
}
```

The response returns the new rate type. Use its `id` as the `rate_type_id` when you [create rates](https://docs.silnahealth.com/api-reference/v1ratesresource/create-rates.md).


## OpenAPI

````yaml post /public/v1/rate-types/
openapi: 3.0.2
info:
  title: Silna Public API
  version: '1.0'
servers:
  - url: https://app.silnahealth.com/api
security:
  - bearerAuth: []
paths:
  /public/v1/rate-types/:
    post:
      tags:
        - V1RateTypesResource
      summary: Create Rate Type
      operationId: V1RateTypesResource.post
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1RateTypeCreateBody'
        description: ''
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1RateType'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
                description: The maximum number of requests allowed in the time window
            X-RateLimit-Remaining:
              schema:
                type: integer
                description: The number of requests remaining in the current time window
            X-RateLimit-Reset:
              schema:
                type: integer
                description: The time when the rate limit will reset, in Unix timestamp
            Retry-After:
              schema:
                type: number
                description: The number of seconds to wait before making another request
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
                description: The maximum number of requests allowed in the time window
            X-RateLimit-Remaining:
              schema:
                type: integer
                description: The number of requests remaining in the current time window
            X-RateLimit-Reset:
              schema:
                type: integer
                description: The time when the rate limit will reset, in Unix timestamp
            Retry-After:
              schema:
                type: number
                description: The number of seconds to wait before making another request
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
                description: The maximum number of requests allowed in the time window
            X-RateLimit-Remaining:
              schema:
                type: integer
                description: The number of requests remaining in the current time window
            X-RateLimit-Reset:
              schema:
                type: integer
                description: The time when the rate limit will reset, in Unix timestamp
            Retry-After:
              schema:
                type: number
                description: The number of seconds to wait before making another request
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectNotFoundError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
                description: The maximum number of requests allowed in the time window
            X-RateLimit-Remaining:
              schema:
                type: integer
                description: The number of requests remaining in the current time window
            X-RateLimit-Reset:
              schema:
                type: integer
                description: The time when the rate limit will reset, in Unix timestamp
            Retry-After:
              schema:
                type: number
                description: The number of seconds to wait before making another request
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
                description: The maximum number of requests allowed in the time window
            X-RateLimit-Remaining:
              schema:
                type: integer
                description: The number of requests remaining in the current time window
            X-RateLimit-Reset:
              schema:
                type: integer
                description: The time when the rate limit will reset, in Unix timestamp
            Retry-After:
              schema:
                type: number
                description: The number of seconds to wait before making another request
        '429':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsError'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
                description: The maximum number of requests allowed in the time window
            X-RateLimit-Remaining:
              schema:
                type: integer
                description: The number of requests remaining in the current time window
            X-RateLimit-Reset:
              schema:
                type: integer
                description: The time when the rate limit will reset, in Unix timestamp
            Retry-After:
              schema:
                type: number
                description: The number of seconds to wait before making another request
components:
  schemas:
    V1RateTypeCreateBody:
      properties:
        provider_id:
          default: null
          description: The provider's Silna identifier
          title: Provider Id
          nullable: true
          format: uuid
          type: string
        mso_id:
          default: null
          description: The MSO's Silna identifier
          title: Mso Id
          nullable: true
          format: uuid
          type: string
        name:
          description: Rate type name
          maxLength: 50
          minLength: 1
          title: Name
          type: string
          example: '97110'
        duration:
          $ref: '#/components/schemas/RateDuration'
          default: PER_VISIT
          description: The unit of time the rate amount applies to
      required:
        - name
      title: V1RateTypeCreateBody
      type: object
      x-folder: public_api
    V1RateType:
      properties:
        id:
          description: The rate type's Silna identifier
          format: uuid
          title: Id
          type: string
        name:
          description: Rate type name
          title: Name
          type: string
          example: '97110'
        duration:
          $ref: '#/components/schemas/RateDuration'
          description: The unit of time the rate amount applies to
      required:
        - id
        - name
        - duration
      title: V1RateType
      type: object
      x-folder: public_api
    ValidationError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human readable error message
      x-folder: null
    AuthenticationError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human readable error message
        type:
          $ref: '#/components/schemas/PublicApiErrorType'
      x-folder: null
    ObjectNotFoundError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human readable error message
      x-folder: null
    ConflictError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human readable error message
      x-folder: null
    TooManyRequestsError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human readable error message
      x-folder: null
    RateDuration:
      type: string
      enum:
        - PER_VISIT
        - PER_HOUR
        - PER_DAY
        - PER_SESSION
        - PER_MONTH
        - PER_WEEK
        - PER_PHASE
        - NONE_HIDDEN
      x-folder: provider
    PublicApiErrorType:
      type: string
      enum:
        - AUTH_INVALID_REQUEST_HEADER
        - AUTH_INVALID_CREDENTIALS
      x-folder: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.