Afya-Health
  1. Category
Afya-Health
  • Auth
    • Login
      POST
    • Signup
      POST
  • ForgotPassword
    • Verify OTP
      POST
    • ForgotPassword
      POST
    • ResetPassword
      POST
  • Profile
    • Get User Profile
      GET
    • Update user profile
      POST
  • Family Members
    • Add Family Member
      POST
    • Update Family Members
      PUT
    • Delete Family Member
      DELETE
  • Address
    • Get User address
      GET
    • Add Address
      POST
    • Update address
      PUT
    • Delete Address
      DELETE
  • Languages
    • List AppLabels
      GET
    • Add/Update Label
      POST
    • List Languages
      GET
  • Products
    • Get Products
      GET
    • Create Product
      POST
    • Update Product
      PUT
    • Delete Product
      DELETE
    • Update product items
      PUT
  • Permissions
    • Get Permissions
  • Config
    • List Practice Config
    • Add Update Config
    • List Master Config
    • Add Update Master Config
  • Appointment Schedule
    • Create Schedule
    • Update Schedule
    • Delete Schedule
    • Get Schedule by ID
    • Get Schedule list
  • Test Tags
    • Get Test Tags
    • Create Test Tag
    • Update Test Tag
    • Delete Test Tag
  • Test Parameters
    • Get Test Parameters
    • Create Test Parameters
    • Update Test Parameters
    • Delete Test Parameters
  • Category
    • Get Category
      GET
    • Create Category
      POST
    • Update Category
      PUT
    • Delete Category
      DELETE
  • Device
    • Register Device
  • File
    • Upload File
  • Appointment
    • Create Appointment Order
    • Get Appointments List
    • Update Appointment Status
    • Get Appointment by ID
    • Get Appointment Slots
    • GetStartJourneyDirection
  • Reports
    • Upload Report
    • List All Reports
    • List Reports By Appointment
    • Delete Report
    • Update Report File
  • Staff
    • Add Staff Member
    • List Staff Member
    • Update Staff Member
    • Delete Staff Member
    • Get Staff member by ID
  • Patient
    • List Patients
    • Add Patient
    • Update Patient
    • Delete Patient
    • Get patient by ID
  • Notifications
    • List User Notifications
    • Update Notification read status
  1. Category

Create Category

Developing
POST
/api/service/v1/categories

Request

Query Params
parent
string 
optional
Example:
6790d7c19975d85c7b447c53
type
string 
optional
Example:
service
Header Params
Accept
string 
optional
Example:
application/json
Content-Type
string 
optional
Example:
application/json
practice-code
string 
optional
Example:
DEFAULT
Authorization
string 
optional
Example:
{{token}}
Body Params application/json
title
object 
required
en
string 
required
ar
string 
required
type
string 
required
color
string 
required
parent
string 
required
image
string 
required
slug
string 
required
fee_type
string 
required
fee_amount
integer 
required
fee_currency
string 
required
Example
{
    "title" :{
        "en" : "english title editred",
        "ar" : "ar title"
    },
    "type" : "service",
    "color": "#FF7689",
    "parent": "6790d7c19975d85c7b447c53",
    "image": "6797541deb8b1053d7d780c1",
    "slug": "the_slug",
    "fee_type": "flat",
    "fee_amount": 10,
    "fee_currency" : "SAR"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://afyahealth.doctodoor.com:5600/api/service/v1/categories?parent=6790d7c19975d85c7b447c53&type=service' \
--header 'Accept: application/json' \
--header 'practice-code: DEFAULT' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3YjJkZmZlNWJmMjdlMzk1NTUzMjE0MyIsImVtYWlsIjoiZGVlcC5tYXJzb25pYUBwbGVuYXJ0ZWNoLmNvbSIsInN1YiI6IjY3YjJkZmZlNWJmMjdlMzk1NTUzMjE0MyIsImlhdCI6MTc0MTc4MjA4NCwiZXhwIjoxNzQ5NTU4MDg0fQ.KAMsweSbJPDxpLijKdjgp3YEFauw8KYLLumCBpqQfAA' \
--header 'Content-Type: application/json' \
--data-raw '{
    "title" :{
        "en" : "english title editred",
        "ar" : "ar title"
    },
    "type" : "service",
    "color": "#FF7689",
    "parent": "6790d7c19975d85c7b447c53",
    "image": "6797541deb8b1053d7d780c1",
    "slug": "the_slug",
    "fee_type": "flat",
    "fee_amount": 10,
    "fee_currency" : "SAR"
}'

Responses

🟢200Success
application/json
Body
error
boolean 
required
status_code
integer 
required
message
string 
required
data
object 
required
parent
object 
required
is_deleted
integer 
required
title
object 
required
type
string 
required
color
string 
required
image
object 
required
created_at
string 
required
updated_at
string 
required
id
string 
required
Examples
{
    "error": false,
    "status_code": 200,
    "message": "Category created Successfully.",
    "data": {
        "parent": {
            "parent": null,
            "is_deleted": 0,
            "title": {
                "en": "this is title2",
                "ar": "arabic title2"
            },
            "type": "service",
            "color": "#FFAAEE",
            "created_at": "2025-01-22T11:34:25.801Z",
            "updated_at": "2025-01-22T11:34:25.801Z",
            "id": "6790d7c19975d85c7b447c53"
        },
        "is_deleted": 0,
        "title": {
            "en": "english title editred",
            "ar": "ar title"
        },
        "type": "service",
        "color": "#FF7689",
        "image": {
            "original_name": "Screenshot from 2025-01-27 12-28-57.png",
            "file_name": "c1db738b-8e3c-4af2-ad43-297cceea1740_1737970715849_Screenshot_from_2025-01-27_12-28-57.png",
            "path": "https://afyahealth.doctodoor.com.s3.us-east-1.amazonaws.com/c1db738b-8e3c-4af2-ad43-297cceea1740_1737970715849_Screenshot_from_2025-01-27_12-28-57.png",
            "size": 3002,
            "mimeType": "image/png",
            "created_at": "2025-01-27T09:38:37.457Z",
            "updated_at": "2025-01-27T09:38:37.457Z",
            "id": "6797541deb8b1053d7d780c1",
            "media_url": "https://d3ektmb2e4ajpb.cloudfront.net/c1db738b-8e3c-4af2-ad43-297cceea1740_1737970715849_Screenshot_from_2025-01-27_12-28-57.png"
        },
        "created_at": "2025-01-27T09:57:25.226Z",
        "updated_at": "2025-01-27T09:57:25.226Z",
        "id": "67975885eb8b1053d7d780e2"
    }
}
Previous
Get Category
Next
Update Category
Built with