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

# Delete Goal

> Delete a goal by goalId. Works for all goal types (behavior, skill, rating, or interval)

## Delete Goal

Delete a goal by goalId. Works for all goal types (frequency\_duration, opportunity, rating, or interval).

### Path Parameters

* `goalId` (required): The goal's public identifier

### Headers

```
Authorization: Bearer <your-api-key>
```

### Success Response (200)

```json theme={null}
{
  "success": true
}
```

### Error Responses

#### 400 - Validation Error

```json theme={null}
{
  "error": "Validation error",
  "details": [
    {
      "code": "invalid_type",
      "message": "Invalid goal ID format",
      "path": ["goalId"]
    }
  ]
}
```

#### 404 - Not Found

```json theme={null}
{
  "error": "Resource not found"
}
```

#### 500 - Internal Server Error

```json theme={null}
{
  "error": "An unexpected error occurred"
}
```

## Examples

### cURL Example

```bash theme={null}
# Delete a goal
curl -X DELETE "https://app.hipp.health/api/v1/goals/goal_123" \
  -H "Authorization: Bearer your-api-key"
```

### JavaScript Example

```javascript theme={null}
const deleteGoal = async (goalId) => {
  const response = await fetch(`/api/v1/goals/${goalId}`, {
    method: "DELETE",
    headers: {
      Authorization: "Bearer your-api-key",
    },
  });

  if (!response.ok) {
    const error = await response.json();
    throw new Error(error.error || "Failed to delete goal");
  }

  return true;
};

// Delete a goal
try {
  await deleteGoal("goal_123");
  console.log("Goal deleted successfully");
} catch (error) {
  console.error("Error deleting goal:", error.message);
}
```


## OpenAPI

````yaml DELETE /v1/goals/{goalId}
openapi: 3.0.0
info:
  title: Hipp Health API
  version: 1.0.0
  description: API for managing users and resources within your Hipp Health organization
servers:
  - url: https://app.hipp.health/api
    description: Production Server
security: []
paths:
  /v1/goals/{goalId}:
    delete:
      tags:
        - V1
      summary: Delete goal by ID
      description: >-
        Delete a goal by goalId. Works for all goal types (behavior, skill,
        rating, or interval)
      operationId: delete-v1-goals-{goalId}
      parameters:
        - in: path
          name: goalId
          schema:
            type: string
          required: true
          example: goal_123
      responses:
        '200':
          description: Deleted goal successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteGoalResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    DeleteGoalResponse:
      type: object
      properties:
        success:
          type: boolean
    ValidationError:
      type: object
      properties:
        error:
          type: string
          example: Validation error
        details:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                example: invalid_string
              message:
                type: string
                example: Valid email is required
              path:
                type: array
                items:
                  type: string
                example:
                  - email
  responses:
    '400':
      description: Bad Request - Validation Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: An unexpected error occurred

````